复制链接
克隆策略

    {"description":"实验创建于2018/6/27","graph":{"edges":[{"to_node_id":"-353:instruments","from_node_id":"-51:data"},{"to_node_id":"-370:instruments","from_node_id":"-51:data"},{"to_node_id":"-353:features","from_node_id":"-59:data"},{"to_node_id":"-360:features","from_node_id":"-59:data"},{"to_node_id":"-1372:input_1","from_node_id":"-353:data"},{"to_node_id":"-865:input_data","from_node_id":"-360:data"},{"to_node_id":"-531:input_data","from_node_id":"-390:sorted_data"},{"to_node_id":"-370:options_data","from_node_id":"-531:data"},{"to_node_id":"-93:input_data","from_node_id":"-865:data"},{"to_node_id":"-390:input_ds","from_node_id":"-93:data"},{"to_node_id":"-443:input_data","from_node_id":"-220:data"},{"to_node_id":"-220:instruments","from_node_id":"-226:data"},{"to_node_id":"-220:features","from_node_id":"-234:data"},{"to_node_id":"-443:features","from_node_id":"-234:data"},{"to_node_id":"-2883:input_1","from_node_id":"-443:data"},{"to_node_id":"-360:input_data","from_node_id":"-1372:data"},{"to_node_id":"-2883:input_2","from_node_id":"-2864:data"},{"to_node_id":"-2864:instruments","from_node_id":"-2870:data"},{"to_node_id":"-2864:features","from_node_id":"-2878:data"},{"to_node_id":"-1372:input_2","from_node_id":"-2883:data"}],"nodes":[{"node_id":"-51","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2020-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2021-12-31","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":"-51"}],"output_ports":[{"name":"data","node_id":"-51"}],"cacheable":true,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"-59","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"# #号开始的表示注释\n# 多个特征,每行一个,可以包含基础特征和衍生特征\nshouyi=(close_0-open_1)/open_1\namount_zf=amount_0/amount_1\namount_bl=amount_0/avg_amount_180\nzgzzf=high_0/close_1\nzhangf=(close_0-open_0)/close_1\ndbzs_zhangf=(close_0-open_0)/open_0 - zs_zhangf\ndbzs_return=return_0 - zs_return_0\nzhangf_max=max((close_0-open_0)/open_0,(close_0-close_1)/close_1)\nzhenf=(high_0-low_0)/close_1\nreturn0=return_0\nreturn1=shift(return_0,1)\nreturn3=return_3\nmax10=ts_max(close_0,10)\nmax10d=ts_argmax(close_0,10)\nmin10=ts_min(close_0,10)\nmin10d=ts_argmin(close_0,10)\npriceHighBl10=close_0/max10\npriceLowBl10=close_0/min10\nmax30=ts_max(close_0,30)\nmax30d=ts_argmax(close_0,30)\nmin30=ts_min(close_0,30)\nmin30d=ts_argmin(close_0,30)\npriceHighBl30=close_0/max30\npriceLowBl30=close_0/min30\nzs_huiluo\nzs_return_0\nzs_return_1\nzs_priceHighBl10\nzs_priceLowBl10\nzs_priceHighBl30\nzs_priceLowBl30\ndbzs_priceHighBl10=priceHighBl10-zs_priceHighBl10\ndbzs_priceLowBl10=priceLowBl10-zs_priceLowBl10\ndbzs_priceHighBl30=priceHighBl30-zs_priceHighBl30\ndbzs_priceLowBl30=priceLowBl30-zs_priceLowBl30\nmf_net_pct_l_0\nmf_net_pct_m_0\nmf_net_pct_main_0\nmf_net_pct_s_0\nmf_net_pct_xl_0\nopen_0\nzhangfMax5=ts_max(zhangf,5)\n#当前10天最低价与前10天最低价比值\nlow10bl=min10/shift(min10,10)\n#前10天的最低值与前20天的最高值比值\nhigh20chu10bl=shift(max10,20)/shift(min10,10)\n#当前价格与10天前,15日内的最低价的比值\ncloseOldLow25bl=close_0/shift(ts_min(close_0,15),10)\n#10天前,15日内的最低价与25天前15天的最高价比值\ncloseOldLow25_15bl=shift(ts_min(close_0,15),25)/shift(ts_min(close_0,15),10)\nddzb=mf_net_pct_l_0+mf_net_pct_main_0+mf_net_pct_xl_0\ndbzb30=sum(ddzb,30)\nzlcy=ts_max(max(mf_net_pct_l_0,mf_net_pct_main_0,mf_net_pct_xl_0),5)\n#前10天至40天的振幅\nhpbl30_old=ts_max(shift(close_0,10),30)/ts_min(shift(close_0,10),30)\n#最近10天的振幅\nhpbl10=ts_max(close_0,10)/ts_min(close_0,10)\nisHasZhangt=ts_max(where((return_0>1.09)&(close_0==high_0),1,0),10)\nisHasDiet=ts_max(where((return_0<0.91)&(close_0==low_0),1,0),10)\nmc1=where((zhangf_max>0.05)&(amount_zf<1),1,0)\nmc2=where(close_0<mean(close_0,5),1,0)\nmc3=where((return_0<1)&(close_0<open_0),1,0)\nmc4=where((zhenf>0.08)&(return_0<1.025),1,0)\n#连续下跌天数\nisXiaDie0=where(return_0<1,1,0)\nlxxd_1d=where(sum(isXiaDie0,1)==1,1,0)\nlxxd_2d=where(sum(isXiaDie0,2)==2,2,0)\nlxxd_3d=where(sum(isXiaDie0,3)==3,3,0)\nlxxd_4d=where(sum(isXiaDie0,4)==4,4,0)\nlxxd_5d=where(sum(isXiaDie0,5)==5,5,0)\nlxxd_6d=where(sum(isXiaDie0,6)==6,6,0)\nlxxd_8d=where(sum(isXiaDie0,8)==8,8,0)\nlxxd_10d=where(sum(isXiaDie0,10)==10,10,0)\nlxxd_days=max(lxxd_1d,lxxd_2d,lxxd_3d,lxxd_4d,lxxd_5d,lxxd_6d,lxxd_8d,lxxd_10d)\n#连续上涨天数\nisShangZ0=where(return_0>1,1,0)\nlxsz_1d=where(sum(isShangZ0,1)==1,1,0)\nlxsz_2d=where(sum(isShangZ0,2)==2,2,0)\nlxsz_3d=where(sum(isShangZ0,3)==3,3,0)\nlxsz_4d=where(sum(isShangZ0,4)==4,4,0)\nlxsz_5d=where(sum(isShangZ0,5)==5,5,0)\nlxsz_6d=where(sum(isShangZ0,6)==6,6,0)\nlxsz_8d=where(sum(isShangZ0,8)==8,8,0)\nlxsz_10d=where(sum(isShangZ0,10)==10,10,0)\nlxsz_days=max(lxsz_1d,lxsz_2d,lxsz_3d,lxsz_4d,lxsz_5d,lxsz_6d,lxsz_8d,lxsz_10d)\njx5d=mean(close_0,5)\nisLxsz=where((jx5d/shift(jx5d,5)>1)&(shift(jx5d,5)/shift(jx5d,10)>1),1,0)\n#与值数涨幅的相关性\nzszf_xgx_1=where((zs_return_0>1)&(return_0<1),1,0)\nmaxZhangf5=ts_max(zhangf,5)\nmaxZhangf5d=ts_argmax(zhangf,5)\nmaxZhangfOpen=where(maxZhangf5d>3,open_0,where(maxZhangf5d>2,shift(open_0,1),where(maxZhangf5d>1,shift(open_0,2),where(maxZhangf5d>0,shift(open_0,3),0))))\nzhangf_low_bl=close_0/maxZhangfOpen\nminZhangfLow=maxZhangfOpen/min(open_1,close_1,open_0)-1\n#20年,胜率0.6,盈亏比2.91;18年3年胜率0.52,盈亏比1.94\nmy1=where((abs(return0-1.02)<0.015)&(priceHighBl10==1)&(priceLowBl10<1.08)&(abs(priceHighBl30-0.9)<0.05)&(abs(priceLowBl30-1.12)<0.05)&(amount_bl>3)&(amount_zf>1)&(dbzs_return>0)&(return0>return1)&((return3+zgzzf)<2.1),1,0)\n#20年,胜率0.65,盈亏比2.51;18年3年,0.71,1.39,97支;\nmy3=where((return0>1)&(return1>1)&(zhangf>0)&(return3<0.97)&(priceHighBl10<0.88)&(priceLowBl10<1.07)&(priceHighBl30==priceHighBl10)&(priceLowBl30==priceLowBl10)&(dbzs_return>0)&(ddzb>0.05),1,0)\n#18年3年,0.65胜,1.39盈亏比\nmy6=where((abs(return0-1.02)<0.01)&(return0>return1)&(lxsz_days==2)&((return0+return1)<2.04)&(return3<1)&(priceHighBl10<0.93)&(priceLowBl10<1.12)&(priceHighBl30==priceHighBl10)&(priceLowBl30==priceLowBl10)&(dbzs_return>0),1,0)\n#18年3年,0.57胜,1.96盈亏比\nmy8=where((return0>return1)&(zhangf>0)&(zhenf<0.025)&(abs(return1-0.99)<0.005)&(priceLowBl10<1.05)&(abs(max10d-7)<3)&(abs(priceHighBl30-0.95)<0.05)&(priceLowBl30<1.15)&(zlcy>0.05)&(amount_bl>1.3)&(max30d<10),1,0)\n#20年155支,胜率0.57,盈亏比1.76;18年3年,胜率0.5,盈亏比1.42\nmy11=where((lxsz_days>2)&(return3<1.06)&(dbzs_return>0)&(priceHighBl10==1)&(priceLowBl10<1.06)&(abs(priceHighBl30-0.9)<0.05)&(abs(priceLowBl30-priceLowBl10)<0.05)&(abs(dbzs_priceHighBl10-0.01)<0.01)&(ts_min(amount_zf,2)>1)&(ddzb>0.05),1,0)\n#按策略优质度排序\nyzd1=where(my3==1,10,0)\nyzd2=where(my6==1,8,0)\nyzd3=where(my8==1,6,0)\nyzd4=where(my1==1,4,0)\nyzd5=where(my11==1,2,0)\nyzd=yzd1+yzd2+yzd3+yzd4+yzd5\nmy=max(my1,my3,my6,my8,my11)\nbuy_condition=where(my==1,1,0)\nsell_condition=where(mc2==3,1,0)\n#gltj=where((shouyi>0.08)&(shouyi<0.2)&(shift(dbzs_return,2)>0)&(shift(dbzs_priceLowBl10,2)<0.05)&(shift(dbzs_priceLowBl30,2)<1.15),1,0)","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-59"}],"output_ports":[{"name":"data","node_id":"-59"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true},{"node_id":"-353","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":"-353"},{"name":"features","node_id":"-353"}],"output_ports":[{"name":"data","node_id":"-353"}],"cacheable":false,"seq_num":5,"comment":"","comment_collapsed":true},{"node_id":"-360","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":"True","type":"Literal","bound_global_parameter":null},{"name":"user_functions","value":"{}","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"-360"},{"name":"features","node_id":"-360"}],"output_ports":[{"name":"data","node_id":"-360"}],"cacheable":true,"seq_num":7,"comment":"","comment_collapsed":true},{"node_id":"-370","module_id":"BigQuantSpace.trade.trade-v4","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\n # 系统已经设置了默认的交易手续费和滑点,要修改手续费可使用如下函数\n context.set_commission(PerOrder(buy_cost=0.0003, sell_cost=0.0013, min_cost=5))\n #context.set_commission(PerOrder(buy_cost=0.00001, sell_cost=0.0001, min_cost=1))\n \n # 设置买入的股票数量,这里买入预测股票列表排名靠前的5只\n context.stock_count = 1\n # 每只的股票的权重,如下的权重分配会使得靠前的股票分配多一点的资金,[0.339160, 0.213986, 0.169580, ..]\n #context.stock_weights = T.norm([1 / math.log(i + 2) for i in range(0, stock_count)])\n # 每只股票的权重平均分配\n context.stock_weights = 1/context.stock_count\n # 设置每只股票占用的最大资金比例\n context.max_cash_per_instrument = 1\n context.options['hold_days'] = 1\n\n","type":"Literal","bound_global_parameter":null},{"name":"handle_data","value":"# 回测引擎:每日数据处理函数,每天执行一次\ndef bigquant_run(context, data):\n today = data.current_dt.strftime('%Y-%m-%d')\n equities = {e.symbol: p for e, p in context.portfolio.positions.items() if p.amount>0}\n stock_now = len(equities); #获取当前持仓股票数量\n stock_count = context.stock_count\n \n # 按日期过滤得到今日的预测数据\n # 加载预测数据\n df = context.options['data'].read_df()\n df_today = df[df.date == data.current_dt.strftime('%Y-%m-%d')]\n df_today.set_index('instrument')\n \n \n now_stock = []\n sell_stock = []\n \n try:\n buy_list = context.daily_buy_stock[today]\n except:\n buy_list = []\n\n \n # 1. 资金分配\n #is_staging = context.trading_day_index < context.options['hold_days'] # 是否在建仓期间(前 hold_days 天) \n #stock_cash = context.portfolio.portfolio_value/stock_count\n #cash_avg = context.portfolio.portfolio_value\n #cash_for_buy = min(context.portfolio.cash, stock_cash)\n #cash_for_sell = cash_avg - (context.portfolio.cash - cash_for_buy)\n \n positions = {e.symbol: p.amount * p.last_sale_price\n for e, p in context.perf_tracker.position_tracker.positions.items()}\n \n \n #if not is_staging :\n if 1==1 : \n if len(equities) > 0:\n for i in equities.keys():\n last_sale_date = equities[i].last_sale_date\t# 上次交易日期\n delta_days = data.current_dt - last_sale_date \n hold_days = delta_days.days # 持仓天数\n if hold_days >= context.options['hold_days'] and i not in buy_list :\n print('日期:',today,'卖出2:',i)\n context.order_target(context.symbol(i), 0)\n sell_stock.append(i)\n stock_now = stock_now -1\n #print('日期:', today, '股票:', i, ' 卖出')\n \n# 3. 生成买入订单\n buy_num = stock_count - stock_now\n #if is_staging :\n # buy_num = 1\n if len(buy_list)>0:\n print('日期:', today, '选出股票数量:', len(buy_list))\n if buy_num>0 and len(buy_list)>0 :\n # 不再买入已经轮仓卖出和移动止损的股票,以防止出现空头持仓\n buy_instruments = [i for i in buy_list if i not in now_stock][:buy_num]\n cash_for_buy = context.portfolio.cash/len(buy_instruments)\n for i, instrument in enumerate(buy_instruments):\n current_price = data.current(context.symbol(instrument), 'price')\n \n if cash_for_buy>0 and data.can_trade(context.symbol(instrument)): \n amount = math.floor(cash_for_buy / current_price / 100) * 100\n context.order(context.symbol(instrument), amount)\n #if(instrument=='002735.SZA'):\n print('日期:',today,'买入:',instrument)\n else :\n print('日期:',today,'无资金或不能交易未买入:',instrument)","type":"Literal","bound_global_parameter":null},{"name":"prepare","value":"# 回测引擎:准备数据,只执行一次\ndef bigquant_run(context):\n # 加载预测数据\n df = context.options['data'].read_df()\n # 函数:求满足开仓条件的股票列表\n def open_pos_con(df):\n return list(df[df['buy_condition']>0].instrument)\n # 函数:求满足平仓条件的股票列表\n def close_pos_con(df):\n return list(df[df['sell_condition']>0].instrument)\n \n # 每日卖出股票的数据框\n context.daily_sell_stock= df.groupby('date').apply(close_pos_con) \n # 每日买入股票的数据框\n context.daily_buy_stock= df.groupby('date').apply(open_pos_con) \n\n\n \n","type":"Literal","bound_global_parameter":null},{"name":"before_trading_start","value":"# 回测引擎:每个单位时间开始前调用一次,即每日开盘前调用一次。\ndef bigquant_run(context, data):\n pass\n","type":"Literal","bound_global_parameter":null},{"name":"volume_limit","value":0.025,"type":"Literal","bound_global_parameter":null},{"name":"order_price_field_buy","value":"open","type":"Literal","bound_global_parameter":null},{"name":"order_price_field_sell","value":"close","type":"Literal","bound_global_parameter":null},{"name":"capital_base","value":"100000","type":"Literal","bound_global_parameter":null},{"name":"auto_cancel_non_tradable_orders","value":"True","type":"Literal","bound_global_parameter":null},{"name":"data_frequency","value":"daily","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":"plot_charts","value":"True","type":"Literal","bound_global_parameter":null},{"name":"backtest_only","value":"False","type":"Literal","bound_global_parameter":null},{"name":"benchmark","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-370"},{"name":"options_data","node_id":"-370"},{"name":"history_ds","node_id":"-370"},{"name":"benchmark_ds","node_id":"-370"},{"name":"trading_calendar","node_id":"-370"}],"output_ports":[{"name":"raw_perf","node_id":"-370"}],"cacheable":false,"seq_num":8,"comment":"","comment_collapsed":true},{"node_id":"-390","module_id":"BigQuantSpace.sort.sort-v4","parameters":[{"name":"sort_by","value":"yzd","type":"Literal","bound_global_parameter":null},{"name":"group_by","value":"date","type":"Literal","bound_global_parameter":null},{"name":"keep_columns","value":"--","type":"Literal","bound_global_parameter":null},{"name":"ascending","value":"False","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_ds","node_id":"-390"},{"name":"sort_by_ds","node_id":"-390"}],"output_ports":[{"name":"sorted_data","node_id":"-390"}],"cacheable":true,"seq_num":9,"comment":"","comment_collapsed":true},{"node_id":"-531","module_id":"BigQuantSpace.filter.filter-v3","parameters":[{"name":"expr","value":"my==1","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":"-531"}],"output_ports":[{"name":"data","node_id":"-531"},{"name":"left_data","node_id":"-531"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true},{"node_id":"-865","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%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":"-865"}],"output_ports":[{"name":"data","node_id":"-865"},{"name":"left_data","node_id":"-865"}],"cacheable":true,"seq_num":6,"comment":"","comment_collapsed":true},{"node_id":"-93","module_id":"BigQuantSpace.dropnan.dropnan-v2","parameters":[],"input_ports":[{"name":"input_data","node_id":"-93"},{"name":"features","node_id":"-93"}],"output_ports":[{"name":"data","node_id":"-93"}],"cacheable":true,"seq_num":11,"comment":"","comment_collapsed":true},{"node_id":"-220","module_id":"BigQuantSpace.use_datasource.use_datasource-v1","parameters":[{"name":"datasource_id","value":"bar1d_index_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":"-220"},{"name":"features","node_id":"-220"}],"output_ports":[{"name":"data","node_id":"-220"}],"cacheable":true,"seq_num":4,"comment":"","comment_collapsed":true},{"node_id":"-226","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2010-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2050-12-30","type":"Literal","bound_global_parameter":null},{"name":"market","value":"CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"instrument_list","value":"000002.HIX","type":"Literal","bound_global_parameter":null},{"name":"max_count","value":0,"type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"rolling_conf","node_id":"-226"}],"output_ports":[{"name":"data","node_id":"-226"}],"cacheable":true,"seq_num":10,"comment":"","comment_collapsed":true},{"node_id":"-234","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nzs_zhangf=(close-open)/open\nzs_huiluo=(high-close)/close\nzs_huishen=(close-low)/low\nzs_zhenf=(high-low)/shift(close,1)\nzs_volume_zf=volume/shift(volume,1)\nzs_return_0=close/shift(close,1)\nzs_return_1=shift(zs_return_0,1)\nzs_return_2=shift(zs_return_0,2)\nzs_max10=ts_max(close,10)\n#zs_max10d=ts_argmax(close,10)\nzs_max30=ts_max(close,30)\n#zs_max30d=ts_argmax(close,30)\nzs_min10=ts_min(close,10)\n#zs_min10d=ts_argmin(close,10)\nzs_min30=ts_min(close,30)\n#zs_min30d=ts_argmin(close,30)\nzs_priceHighBl10=close/zs_max10\nzs_priceLowBl10=close/zs_min10\nzs_priceHighBl30=close/zs_max30\nzs_priceLowBl30=close/zs_min30","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-234"}],"output_ports":[{"name":"data","node_id":"-234"}],"cacheable":true,"seq_num":12,"comment":"","comment_collapsed":true},{"node_id":"-443","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":"True","type":"Literal","bound_global_parameter":null},{"name":"user_functions","value":"{}","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"-443"},{"name":"features","node_id":"-443"}],"output_ports":[{"name":"data","node_id":"-443"}],"cacheable":true,"seq_num":13,"comment":"","comment_collapsed":true},{"node_id":"-1372","module_id":"BigQuantSpace.data_join.data_join-v3","parameters":[{"name":"on","value":"date","type":"Literal","bound_global_parameter":null},{"name":"how","value":"left","type":"Literal","bound_global_parameter":null},{"name":"sort","value":"True","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-1372"},{"name":"input_2","node_id":"-1372"}],"output_ports":[{"name":"data","node_id":"-1372"}],"cacheable":true,"seq_num":14,"comment":"","comment_collapsed":true},{"node_id":"-2864","module_id":"BigQuantSpace.use_datasource.use_datasource-v1","parameters":[{"name":"datasource_id","value":"bar1d_index_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":"-2864"},{"name":"features","node_id":"-2864"}],"output_ports":[{"name":"data","node_id":"-2864"}],"cacheable":true,"seq_num":17,"comment":"","comment_collapsed":true},{"node_id":"-2870","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2020-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2020-12-30","type":"Literal","bound_global_parameter":null},{"name":"market","value":"CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"instrument_list","value":"000002.HIX","type":"Literal","bound_global_parameter":null},{"name":"max_count","value":0,"type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"rolling_conf","node_id":"-2870"}],"output_ports":[{"name":"data","node_id":"-2870"}],"cacheable":true,"seq_num":18,"comment":"","comment_collapsed":true},{"node_id":"-2878","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nclose\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-2878"}],"output_ports":[{"name":"data","node_id":"-2878"}],"cacheable":true,"seq_num":19,"comment":"","comment_collapsed":true},{"node_id":"-2883","module_id":"BigQuantSpace.data_join.data_join-v3","parameters":[{"name":"on","value":"date","type":"Literal","bound_global_parameter":null},{"name":"how","value":"left","type":"Literal","bound_global_parameter":null},{"name":"sort","value":"False","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-2883"},{"name":"input_2","node_id":"-2883"}],"output_ports":[{"name":"data","node_id":"-2883"}],"cacheable":true,"seq_num":20,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-51' Position='132,6,200,200'/><node_position Node='-59' Position='477.68682861328125,83.20435333251953,200,200'/><node_position Node='-353' Position='257,236,200,200'/><node_position Node='-360' Position='239,338,200,200'/><node_position Node='-370' Position='478,838,200,200'/><node_position Node='-390' Position='288,618,200,200'/><node_position Node='-531' Position='301,706,200,200'/><node_position Node='-865' Position='261,433,200,200'/><node_position Node='-93' Position='269,519,200,200'/><node_position Node='-220' Position='801,-38,200,200'/><node_position Node='-226' Position='664,-179,200,200'/><node_position Node='-234' Position='1055,-181,200,200'/><node_position Node='-443' Position='806,119,200,200'/><node_position Node='-1372' Position='770,305,200,200'/><node_position Node='-2864' Position='1274,117,200,200'/><node_position Node='-2870' Position='1137,-23,200,200'/><node_position Node='-2878' Position='1528,-25,200,200'/><node_position Node='-2883' Position='1032,212,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
    In [2]:
    # 本代码由可视化策略环境自动生成 2022年1月14日 17:33
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    # 回测引擎:初始化函数,只执行一次
    def m8_initialize_bigquant_run(context):
    
        # 系统已经设置了默认的交易手续费和滑点,要修改手续费可使用如下函数
        context.set_commission(PerOrder(buy_cost=0.0003, sell_cost=0.0013, min_cost=5))
        #context.set_commission(PerOrder(buy_cost=0.00001, sell_cost=0.0001, min_cost=1))
        
        # 设置买入的股票数量,这里买入预测股票列表排名靠前的5只
        context.stock_count = 1
        # 每只的股票的权重,如下的权重分配会使得靠前的股票分配多一点的资金,[0.339160, 0.213986, 0.169580, ..]
        #context.stock_weights = T.norm([1 / math.log(i + 2) for i in range(0, stock_count)])
        # 每只股票的权重平均分配
        context.stock_weights = 1/context.stock_count
        # 设置每只股票占用的最大资金比例
        context.max_cash_per_instrument = 1
        context.options['hold_days'] = 1
    
    
    # 回测引擎:每日数据处理函数,每天执行一次
    def m8_handle_data_bigquant_run(context, data):
        today = data.current_dt.strftime('%Y-%m-%d')
        equities = {e.symbol: p for e, p in context.portfolio.positions.items() if p.amount>0}
        stock_now = len(equities); #获取当前持仓股票数量
        stock_count = context.stock_count
        
        # 按日期过滤得到今日的预测数据
        # 加载预测数据
        df = context.options['data'].read_df()
        df_today = df[df.date == data.current_dt.strftime('%Y-%m-%d')]
        df_today.set_index('instrument')
        
        
        now_stock = []
        sell_stock = []
           
        try:
            buy_list = context.daily_buy_stock[today]
        except:
            buy_list = []
    
        
        # 1. 资金分配
        #is_staging = context.trading_day_index < context.options['hold_days'] # 是否在建仓期间(前 hold_days 天) 
        #stock_cash = context.portfolio.portfolio_value/stock_count
        #cash_avg = context.portfolio.portfolio_value
        #cash_for_buy = min(context.portfolio.cash,  stock_cash)
        #cash_for_sell = cash_avg - (context.portfolio.cash - cash_for_buy)
        
        positions = {e.symbol: p.amount * p.last_sale_price
                     for e, p in context.perf_tracker.position_tracker.positions.items()}
        
                
        #if not is_staging :
        if 1==1 :    
            if len(equities) > 0:
                for i in equities.keys():
                    last_sale_date = equities[i].last_sale_date	# 上次交易日期
                    delta_days = data.current_dt - last_sale_date  
                    hold_days = delta_days.days # 持仓天数
                    if hold_days >= context.options['hold_days'] and i not in buy_list :
                        print('日期:',today,'卖出2:',i)
                        context.order_target(context.symbol(i), 0)
                        sell_stock.append(i)
                        stock_now = stock_now -1
                        #print('日期:', today, '股票:', i, ' 卖出')
                     
    # 3. 生成买入订单
        buy_num = stock_count - stock_now
        #if is_staging :
        #    buy_num = 1
        if len(buy_list)>0:
            print('日期:', today, '选出股票数量:', len(buy_list))
        if buy_num>0 and len(buy_list)>0 :
            # 不再买入已经轮仓卖出和移动止损的股票,以防止出现空头持仓
            buy_instruments = [i for i in buy_list if i not in now_stock][:buy_num]
            cash_for_buy = context.portfolio.cash/len(buy_instruments)
            for i, instrument in enumerate(buy_instruments):
                current_price = data.current(context.symbol(instrument), 'price')
                
                if cash_for_buy>0 and data.can_trade(context.symbol(instrument)):           
                    amount = math.floor(cash_for_buy / current_price / 100) * 100
                    context.order(context.symbol(instrument), amount)
                    #if(instrument=='002735.SZA'):
                    print('日期:',today,'买入:',instrument)
                else :
                    print('日期:',today,'无资金或不能交易未买入:',instrument)
    # 回测引擎:准备数据,只执行一次
    def m8_prepare_bigquant_run(context):
        # 加载预测数据
        df = context.options['data'].read_df()
        # 函数:求满足开仓条件的股票列表
        def open_pos_con(df):
            return list(df[df['buy_condition']>0].instrument)
        # 函数:求满足平仓条件的股票列表
        def close_pos_con(df):
            return list(df[df['sell_condition']>0].instrument)
        
        # 每日卖出股票的数据框
        context.daily_sell_stock= df.groupby('date').apply(close_pos_con)  
        # 每日买入股票的数据框
        context.daily_buy_stock= df.groupby('date').apply(open_pos_con)  
    
    
        
    
    # 回测引擎:每个单位时间开始前调用一次,即每日开盘前调用一次。
    def m8_before_trading_start_bigquant_run(context, data):
        pass
    
    
    m1 = M.instruments.v2(
        start_date='2020-01-01',
        end_date=T.live_run_param('trading_date', '2021-12-31'),
        market='CN_STOCK_A',
        instrument_list='',
        max_count=0
    )
    
    m2 = M.input_features.v1(
        features="""# #号开始的表示注释
    # 多个特征,每行一个,可以包含基础特征和衍生特征
    shouyi=(close_0-open_1)/open_1
    amount_zf=amount_0/amount_1
    amount_bl=amount_0/avg_amount_180
    zgzzf=high_0/close_1
    zhangf=(close_0-open_0)/close_1
    dbzs_zhangf=(close_0-open_0)/open_0 - zs_zhangf
    dbzs_return=return_0 - zs_return_0
    zhangf_max=max((close_0-open_0)/open_0,(close_0-close_1)/close_1)
    zhenf=(high_0-low_0)/close_1
    return0=return_0
    return1=shift(return_0,1)
    return3=return_3
    max10=ts_max(close_0,10)
    max10d=ts_argmax(close_0,10)
    min10=ts_min(close_0,10)
    min10d=ts_argmin(close_0,10)
    priceHighBl10=close_0/max10
    priceLowBl10=close_0/min10
    max30=ts_max(close_0,30)
    max30d=ts_argmax(close_0,30)
    min30=ts_min(close_0,30)
    min30d=ts_argmin(close_0,30)
    priceHighBl30=close_0/max30
    priceLowBl30=close_0/min30
    zs_huiluo
    zs_return_0
    zs_return_1
    zs_priceHighBl10
    zs_priceLowBl10
    zs_priceHighBl30
    zs_priceLowBl30
    dbzs_priceHighBl10=priceHighBl10-zs_priceHighBl10
    dbzs_priceLowBl10=priceLowBl10-zs_priceLowBl10
    dbzs_priceHighBl30=priceHighBl30-zs_priceHighBl30
    dbzs_priceLowBl30=priceLowBl30-zs_priceLowBl30
    mf_net_pct_l_0
    mf_net_pct_m_0
    mf_net_pct_main_0
    mf_net_pct_s_0
    mf_net_pct_xl_0
    open_0
    zhangfMax5=ts_max(zhangf,5)
    #当前10天最低价与前10天最低价比值
    low10bl=min10/shift(min10,10)
    #前10天的最低值与前20天的最高值比值
    high20chu10bl=shift(max10,20)/shift(min10,10)
    #当前价格与10天前,15日内的最低价的比值
    closeOldLow25bl=close_0/shift(ts_min(close_0,15),10)
    #10天前,15日内的最低价与25天前15天的最高价比值
    closeOldLow25_15bl=shift(ts_min(close_0,15),25)/shift(ts_min(close_0,15),10)
    ddzb=mf_net_pct_l_0+mf_net_pct_main_0+mf_net_pct_xl_0
    dbzb30=sum(ddzb,30)
    zlcy=ts_max(max(mf_net_pct_l_0,mf_net_pct_main_0,mf_net_pct_xl_0),5)
    #前10天至40天的振幅
    hpbl30_old=ts_max(shift(close_0,10),30)/ts_min(shift(close_0,10),30)
    #最近10天的振幅
    hpbl10=ts_max(close_0,10)/ts_min(close_0,10)
    isHasZhangt=ts_max(where((return_0>1.09)&(close_0==high_0),1,0),10)
    isHasDiet=ts_max(where((return_0<0.91)&(close_0==low_0),1,0),10)
    mc1=where((zhangf_max>0.05)&(amount_zf<1),1,0)
    mc2=where(close_0<mean(close_0,5),1,0)
    mc3=where((return_0<1)&(close_0<open_0),1,0)
    mc4=where((zhenf>0.08)&(return_0<1.025),1,0)
    #连续下跌天数
    isXiaDie0=where(return_0<1,1,0)
    lxxd_1d=where(sum(isXiaDie0,1)==1,1,0)
    lxxd_2d=where(sum(isXiaDie0,2)==2,2,0)
    lxxd_3d=where(sum(isXiaDie0,3)==3,3,0)
    lxxd_4d=where(sum(isXiaDie0,4)==4,4,0)
    lxxd_5d=where(sum(isXiaDie0,5)==5,5,0)
    lxxd_6d=where(sum(isXiaDie0,6)==6,6,0)
    lxxd_8d=where(sum(isXiaDie0,8)==8,8,0)
    lxxd_10d=where(sum(isXiaDie0,10)==10,10,0)
    lxxd_days=max(lxxd_1d,lxxd_2d,lxxd_3d,lxxd_4d,lxxd_5d,lxxd_6d,lxxd_8d,lxxd_10d)
    #连续上涨天数
    isShangZ0=where(return_0>1,1,0)
    lxsz_1d=where(sum(isShangZ0,1)==1,1,0)
    lxsz_2d=where(sum(isShangZ0,2)==2,2,0)
    lxsz_3d=where(sum(isShangZ0,3)==3,3,0)
    lxsz_4d=where(sum(isShangZ0,4)==4,4,0)
    lxsz_5d=where(sum(isShangZ0,5)==5,5,0)
    lxsz_6d=where(sum(isShangZ0,6)==6,6,0)
    lxsz_8d=where(sum(isShangZ0,8)==8,8,0)
    lxsz_10d=where(sum(isShangZ0,10)==10,10,0)
    lxsz_days=max(lxsz_1d,lxsz_2d,lxsz_3d,lxsz_4d,lxsz_5d,lxsz_6d,lxsz_8d,lxsz_10d)
    jx5d=mean(close_0,5)
    isLxsz=where((jx5d/shift(jx5d,5)>1)&(shift(jx5d,5)/shift(jx5d,10)>1),1,0)
    #与值数涨幅的相关性
    zszf_xgx_1=where((zs_return_0>1)&(return_0<1),1,0)
    maxZhangf5=ts_max(zhangf,5)
    maxZhangf5d=ts_argmax(zhangf,5)
    maxZhangfOpen=where(maxZhangf5d>3,open_0,where(maxZhangf5d>2,shift(open_0,1),where(maxZhangf5d>1,shift(open_0,2),where(maxZhangf5d>0,shift(open_0,3),0))))
    zhangf_low_bl=close_0/maxZhangfOpen
    minZhangfLow=maxZhangfOpen/min(open_1,close_1,open_0)-1
    #20年,胜率0.6,盈亏比2.91;18年3年胜率0.52,盈亏比1.94
    my1=where((abs(return0-1.02)<0.015)&(priceHighBl10==1)&(priceLowBl10<1.08)&(abs(priceHighBl30-0.9)<0.05)&(abs(priceLowBl30-1.12)<0.05)&(amount_bl>3)&(amount_zf>1)&(dbzs_return>0)&(return0>return1)&((return3+zgzzf)<2.1),1,0)
    #20年,胜率0.65,盈亏比2.51;18年3年,0.71,1.39,97支;
    my3=where((return0>1)&(return1>1)&(zhangf>0)&(return3<0.97)&(priceHighBl10<0.88)&(priceLowBl10<1.07)&(priceHighBl30==priceHighBl10)&(priceLowBl30==priceLowBl10)&(dbzs_return>0)&(ddzb>0.05),1,0)
    #18年3年,0.65胜,1.39盈亏比
    my6=where((abs(return0-1.02)<0.01)&(return0>return1)&(lxsz_days==2)&((return0+return1)<2.04)&(return3<1)&(priceHighBl10<0.93)&(priceLowBl10<1.12)&(priceHighBl30==priceHighBl10)&(priceLowBl30==priceLowBl10)&(dbzs_return>0),1,0)
    #18年3年,0.57胜,1.96盈亏比
    my8=where((return0>return1)&(zhangf>0)&(zhenf<0.025)&(abs(return1-0.99)<0.005)&(priceLowBl10<1.05)&(abs(max10d-7)<3)&(abs(priceHighBl30-0.95)<0.05)&(priceLowBl30<1.15)&(zlcy>0.05)&(amount_bl>1.3)&(max30d<10),1,0)
    #20年155支,胜率0.57,盈亏比1.76;18年3年,胜率0.5,盈亏比1.42
    my11=where((lxsz_days>2)&(return3<1.06)&(dbzs_return>0)&(priceHighBl10==1)&(priceLowBl10<1.06)&(abs(priceHighBl30-0.9)<0.05)&(abs(priceLowBl30-priceLowBl10)<0.05)&(abs(dbzs_priceHighBl10-0.01)<0.01)&(ts_min(amount_zf,2)>1)&(ddzb>0.05),1,0)
    #按策略优质度排序
    yzd1=where(my3==1,10,0)
    yzd2=where(my6==1,8,0)
    yzd3=where(my8==1,6,0)
    yzd4=where(my1==1,4,0)
    yzd5=where(my11==1,2,0)
    yzd=yzd1+yzd2+yzd3+yzd4+yzd5
    my=max(my1,my3,my6,my8,my11)
    buy_condition=where(my==1,1,0)
    sell_condition=where(mc2==3,1,0)
    #gltj=where((shouyi>0.08)&(shouyi<0.2)&(shift(dbzs_return,2)>0)&(shift(dbzs_priceLowBl10,2)<0.05)&(shift(dbzs_priceLowBl30,2)<1.15),1,0)"""
    )
    
    m5 = M.general_feature_extractor.v7(
        instruments=m1.data,
        features=m2.data,
        start_date='',
        end_date='',
        before_start_days=60,
        m_cached=False
    )
    
    m10 = M.instruments.v2(
        start_date='2010-01-01',
        end_date='2050-12-30',
        market='CN_STOCK_A',
        instrument_list='000002.HIX',
        max_count=0
    )
    
    m12 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    zs_zhangf=(close-open)/open
    zs_huiluo=(high-close)/close
    zs_huishen=(close-low)/low
    zs_zhenf=(high-low)/shift(close,1)
    zs_volume_zf=volume/shift(volume,1)
    zs_return_0=close/shift(close,1)
    zs_return_1=shift(zs_return_0,1)
    zs_return_2=shift(zs_return_0,2)
    zs_max10=ts_max(close,10)
    #zs_max10d=ts_argmax(close,10)
    zs_max30=ts_max(close,30)
    #zs_max30d=ts_argmax(close,30)
    zs_min10=ts_min(close,10)
    #zs_min10d=ts_argmin(close,10)
    zs_min30=ts_min(close,30)
    #zs_min30d=ts_argmin(close,30)
    zs_priceHighBl10=close/zs_max10
    zs_priceLowBl10=close/zs_min10
    zs_priceHighBl30=close/zs_max30
    zs_priceLowBl30=close/zs_min30"""
    )
    
    m4 = M.use_datasource.v1(
        instruments=m10.data,
        features=m12.data,
        datasource_id='bar1d_index_CN_STOCK_A',
        start_date='',
        end_date=''
    )
    
    m13 = M.derived_feature_extractor.v3(
        input_data=m4.data,
        features=m12.data,
        date_col='date',
        instrument_col='instrument',
        drop_na=False,
        remove_extra_columns=True,
        user_functions={}
    )
    
    m18 = M.instruments.v2(
        start_date='2020-01-01',
        end_date='2020-12-30',
        market='CN_STOCK_A',
        instrument_list='000002.HIX',
        max_count=0
    )
    
    m19 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    close
    """
    )
    
    m17 = M.use_datasource.v1(
        instruments=m18.data,
        features=m19.data,
        datasource_id='bar1d_index_CN_STOCK_A',
        start_date='',
        end_date=''
    )
    
    m20 = M.data_join.v3(
        input_1=m13.data,
        input_2=m17.data,
        on='date',
        how='left',
        sort=False
    )
    
    m14 = M.data_join.v3(
        input_1=m5.data,
        input_2=m20.data,
        on='date',
        how='left',
        sort=True
    )
    
    m7 = M.derived_feature_extractor.v3(
        input_data=m14.data,
        features=m2.data,
        date_col='date',
        instrument_col='instrument',
        drop_na=False,
        remove_extra_columns=True,
        user_functions={}
    )
    
    m6 = M.chinaa_stock_filter.v1(
        input_data=m7.data,
        index_constituent_cond=['全部'],
        board_cond=['上证主板', '深证主板'],
        industry_cond=['全部'],
        st_cond=['正常'],
        delist_cond=['非退市'],
        output_left_data=False
    )
    
    m11 = M.dropnan.v2(
        input_data=m6.data
    )
    
    m9 = M.sort.v4(
        input_ds=m11.data,
        sort_by='yzd',
        group_by='date',
        keep_columns='--',
        ascending=False
    )
    
    m3 = M.filter.v3(
        input_data=m9.sorted_data,
        expr='my==1',
        output_left_data=False
    )
    
    m8 = M.trade.v4(
        instruments=m1.data,
        options_data=m3.data,
        start_date='',
        end_date='',
        initialize=m8_initialize_bigquant_run,
        handle_data=m8_handle_data_bigquant_run,
        prepare=m8_prepare_bigquant_run,
        before_trading_start=m8_before_trading_start_bigquant_run,
        volume_limit=0.025,
        order_price_field_buy='open',
        order_price_field_sell='close',
        capital_base=100000,
        auto_cancel_non_tradable_orders=True,
        data_frequency='daily',
        price_type='后复权',
        product_type='股票',
        plot_charts=True,
        backtest_only=False,
        benchmark=''
    )
    
    日期: 2020-01-02 选出股票数量: 1
    日期: 2020-01-02 买入: 600844.SHA
    日期: 2020-01-03 选出股票数量: 4
    日期: 2020-01-06 卖出2: 600844.SHA
    日期: 2020-01-06 选出股票数量: 1
    日期: 2020-01-06 买入: 000552.SZA
    日期: 2020-01-07 选出股票数量: 3
    日期: 2020-01-08 卖出2: 000552.SZA
    日期: 2020-01-14 选出股票数量: 1
    日期: 2020-01-14 买入: 603595.SHA
    日期: 2020-01-16 卖出2: 603595.SHA
    日期: 2020-02-05 选出股票数量: 16
    日期: 2020-02-05 买入: 002258.SZA
    日期: 2020-02-06 选出股票数量: 41
    日期: 2020-02-07 卖出2: 002258.SZA
    日期: 2020-02-19 选出股票数量: 8
    日期: 2020-02-19 买入: 002807.SZA
    日期: 2020-02-20 选出股票数量: 9
    日期: 2020-02-21 卖出2: 002807.SZA
    日期: 2020-02-24 选出股票数量: 4
    日期: 2020-02-24 买入: 600059.SHA
    日期: 2020-02-25 选出股票数量: 8
    日期: 2020-02-26 卖出2: 600059.SHA
    日期: 2020-02-26 选出股票数量: 15
    日期: 2020-02-26 买入: 002039.SZA
    日期: 2020-02-27 选出股票数量: 4
    日期: 2020-02-28 卖出2: 002039.SZA
    日期: 2020-02-28 选出股票数量: 4
    日期: 2020-02-28 买入: 603357.SHA
    日期: 2020-03-02 选出股票数量: 1
    日期: 2020-03-03 卖出2: 603357.SHA
    日期: 2020-03-03 选出股票数量: 1
    日期: 2020-03-03 买入: 600017.SHA
    日期: 2020-03-04 选出股票数量: 4
    日期: 2020-03-05 卖出2: 600017.SHA
    日期: 2020-03-05 选出股票数量: 1
    日期: 2020-03-05 买入: 002936.SZA
    日期: 2020-03-09 卖出2: 002936.SZA
    日期: 2020-03-09 选出股票数量: 2
    日期: 2020-03-09 买入: 601111.SHA
    日期: 2020-03-11 卖出2: 601111.SHA
    日期: 2020-03-11 选出股票数量: 1
    日期: 2020-03-11 买入: 601866.SHA
    日期: 2020-03-13 卖出2: 601866.SHA
    日期: 2020-03-17 选出股票数量: 1
    日期: 2020-03-17 买入: 601339.SHA
    日期: 2020-03-18 选出股票数量: 2
    日期: 2020-03-19 卖出2: 601339.SHA
    日期: 2020-03-19 选出股票数量: 2
    日期: 2020-03-19 买入: 601020.SHA
    日期: 2020-03-20 选出股票数量: 6
    日期: 2020-03-20 买入: 603908.SHA
    日期: 2020-03-23 选出股票数量: 1
    日期: 2020-03-24 卖出2: 603908.SHA
    日期: 2020-03-25 选出股票数量: 3
    日期: 2020-03-25 买入: 600191.SHA
    日期: 2020-03-26 选出股票数量: 4
    日期: 2020-03-27 卖出2: 600191.SHA
    日期: 2020-03-27 选出股票数量: 2
    日期: 2020-03-27 买入: 000411.SZA
    日期: 2020-04-01 选出股票数量: 3
    日期: 2020-04-01 买入: 002490.SZA
    日期: 2020-04-02 选出股票数量: 4
    日期: 2020-04-03 卖出2: 002490.SZA
    日期: 2020-04-03 选出股票数量: 2
    日期: 2020-04-03 买入: 601607.SHA
    日期: 2020-04-07 选出股票数量: 3
    日期: 2020-04-07 买入: 000301.SZA
    日期: 2020-04-08 选出股票数量: 4
    日期: 2020-04-09 卖出2: 000301.SZA
    日期: 2020-04-15 选出股票数量: 6
    日期: 2020-04-15 买入: 600403.SHA
    日期: 2020-04-16 选出股票数量: 5
    日期: 2020-04-17 卖出2: 600403.SHA
    日期: 2020-04-21 选出股票数量: 2
    日期: 2020-04-21 买入: 002672.SZA
    日期: 2020-04-22 选出股票数量: 5
    日期: 2020-04-23 卖出2: 002672.SZA
    日期: 2020-04-23 选出股票数量: 2
    日期: 2020-04-23 买入: 600028.SHA
    日期: 2020-04-24 选出股票数量: 5
    日期: 2020-04-27 卖出2: 600028.SHA
    日期: 2020-04-28 选出股票数量: 1
    日期: 2020-04-28 买入: 002739.SZA
    日期: 2020-04-29 选出股票数量: 2
    日期: 2020-04-30 卖出2: 002739.SZA
    日期: 2020-04-30 选出股票数量: 7
    日期: 2020-04-30 买入: 603928.SHA
    日期: 2020-05-06 选出股票数量: 9
    日期: 2020-05-07 卖出2: 603928.SHA
    日期: 2020-05-07 选出股票数量: 3
    日期: 2020-05-07 买入: 002730.SZA
    日期: 2020-05-11 卖出2: 002730.SZA
    日期: 2020-05-13 选出股票数量: 1
    日期: 2020-05-13 买入: 002880.SZA
    日期: 2020-05-15 卖出2: 002880.SZA
    日期: 2020-05-15 选出股票数量: 2
    日期: 2020-05-15 买入: 002155.SZA
    日期: 2020-05-19 选出股票数量: 1
    日期: 2020-05-19 买入: 601966.SHA
    日期: 2020-05-20 选出股票数量: 1
    日期: 2020-05-21 卖出2: 601966.SHA
    日期: 2020-05-21 选出股票数量: 4
    日期: 2020-05-21 买入: 002774.SZA
    日期: 2020-05-22 选出股票数量: 1
    日期: 2020-05-22 买入: 603838.SHA
    日期: 2020-05-26 卖出2: 603838.SHA
    日期: 2020-05-26 选出股票数量: 2
    日期: 2020-05-26 买入: 603863.SHA
    日期: 2020-05-28 卖出2: 603863.SHA
    日期: 2020-05-28 选出股票数量: 5
    日期: 2020-05-28 买入: 002521.SZA
    日期: 2020-05-29 选出股票数量: 1
    日期: 2020-06-01 卖出2: 002521.SZA
    日期: 2020-06-01 选出股票数量: 1
    日期: 2020-06-01 买入: 600021.SHA
    日期: 2020-06-04 选出股票数量: 4
    日期: 2020-06-04 买入: 000637.SZA
    日期: 2020-06-08 卖出2: 000637.SZA
    日期: 2020-06-09 选出股票数量: 1
    日期: 2020-06-09 买入: 601188.SHA
    日期: 2020-06-11 卖出2: 601188.SHA
    日期: 2020-06-11 选出股票数量: 4
    日期: 2020-06-11 买入: 002287.SZA
    日期: 2020-06-15 卖出2: 601188.SHA
    日期: 2020-06-16 选出股票数量: 4
    日期: 2020-06-16 买入: 600606.SHA
    日期: 2020-06-17 选出股票数量: 1
    日期: 2020-06-18 卖出2: 600606.SHA
    日期: 2020-06-18 选出股票数量: 3
    日期: 2020-06-18 买入: 601228.SHA
    日期: 2020-06-22 卖出2: 601228.SHA
    日期: 2020-06-22 选出股票数量: 2
    日期: 2020-06-22 买入: 002156.SZA
    日期: 2020-06-24 卖出2: 002156.SZA
    日期: 2020-07-01 选出股票数量: 1
    日期: 2020-07-01 买入: 600664.SHA
    日期: 2020-07-03 卖出2: 600664.SHA
    日期: 2020-07-28 选出股票数量: 3
    日期: 2020-07-28 买入: 002616.SZA
    日期: 2020-07-30 卖出2: 002616.SZA
    日期: 2020-07-30 选出股票数量: 5
    日期: 2020-07-30 买入: 000683.SZA
    日期: 2020-08-03 卖出2: 000683.SZA
    日期: 2020-08-11 选出股票数量: 2
    日期: 2020-08-11 买入: 000007.SZA
    日期: 2020-08-12 选出股票数量: 1
    日期: 2020-08-13 卖出2: 000007.SZA
    日期: 2020-08-13 选出股票数量: 2
    日期: 2020-08-13 买入: 000883.SZA
    日期: 2020-08-17 卖出2: 000883.SZA
    日期: 2020-08-17 选出股票数量: 2
    日期: 2020-08-17 买入: 600106.SHA
    日期: 2020-08-19 卖出2: 600106.SHA
    日期: 2020-08-19 选出股票数量: 6
    日期: 2020-08-19 买入: 600871.SHA
    日期: 2020-08-21 卖出2: 600871.SHA
    日期: 2020-08-24 选出股票数量: 6
    日期: 2020-08-24 买入: 603706.SHA
    日期: 2020-08-26 卖出2: 603706.SHA
    日期: 2020-08-28 选出股票数量: 1
    日期: 2020-08-28 买入: 603078.SHA
    日期: 2020-08-31 选出股票数量: 1
    日期: 2020-09-01 卖出2: 603078.SHA
    日期: 2020-09-02 选出股票数量: 2
    日期: 2020-09-02 买入: 002756.SZA
    日期: 2020-09-03 选出股票数量: 1
    日期: 2020-09-04 卖出2: 002756.SZA
    日期: 2020-09-11 选出股票数量: 2
    日期: 2020-09-11 买入: 603538.SHA
    日期: 2020-09-14 选出股票数量: 4
    日期: 2020-09-15 卖出2: 603538.SHA
    日期: 2020-09-15 选出股票数量: 2
    日期: 2020-09-15 买入: 600191.SHA
    日期: 2020-09-18 选出股票数量: 1
    日期: 2020-09-18 买入: 603580.SHA
    日期: 2020-09-21 选出股票数量: 2
    日期: 2020-09-22 卖出2: 603580.SHA
    日期: 2020-09-22 选出股票数量: 1
    日期: 2020-09-22 买入: 000950.SZA
    日期: 2020-09-23 选出股票数量: 1
    日期: 2020-09-24 卖出2: 000950.SZA
    日期: 2020-09-30 选出股票数量: 1
    日期: 2020-09-30 买入: 000040.SZA
    日期: 2020-10-09 选出股票数量: 3
    日期: 2020-10-12 卖出2: 000040.SZA
    日期: 2020-10-15 选出股票数量: 1
    日期: 2020-10-15 买入: 000898.SZA
    日期: 2020-10-19 卖出2: 000898.SZA
    日期: 2020-10-21 选出股票数量: 1
    日期: 2020-10-21 买入: 600000.SHA
    日期: 2020-10-22 选出股票数量: 2
    日期: 2020-10-23 卖出2: 600000.SHA
    日期: 2020-10-28 选出股票数量: 1
    日期: 2020-10-28 买入: 600500.SHA
    日期: 2020-10-29 选出股票数量: 1
    日期: 2020-10-30 卖出2: 600500.SHA
    日期: 2020-11-03 选出股票数量: 3
    日期: 2020-11-03 买入: 603006.SHA
    日期: 2020-11-04 选出股票数量: 1
    日期: 2020-11-05 卖出2: 603006.SHA
    日期: 2020-11-05 选出股票数量: 1
    日期: 2020-11-05 买入: 600022.SHA
    日期: 2020-11-06 选出股票数量: 2
    日期: 2020-11-06 买入: 002032.SZA
    日期: 2020-11-09 选出股票数量: 1
    日期: 2020-11-10 卖出2: 002032.SZA
    日期: 2020-11-10 选出股票数量: 2
    日期: 2020-11-10 买入: 603225.SHA
    日期: 2020-11-11 选出股票数量: 1
    日期: 2020-11-12 卖出2: 603225.SHA
    日期: 2020-11-16 选出股票数量: 7
    日期: 2020-11-16 买入: 600033.SHA
    日期: 2020-11-17 选出股票数量: 4
    日期: 2020-11-18 卖出2: 600033.SHA
    日期: 2020-11-18 选出股票数量: 8
    日期: 2020-11-18 买入: 000090.SZA
    日期: 2020-11-19 选出股票数量: 2
    日期: 2020-11-19 买入: 603617.SHA
    日期: 2020-11-23 卖出2: 603617.SHA
    日期: 2020-11-24 选出股票数量: 3
    日期: 2020-11-24 买入: 601179.SHA
    日期: 2020-11-26 卖出2: 601179.SHA
    日期: 2020-11-26 选出股票数量: 1
    日期: 2020-11-26 买入: 002366.SZA
    日期: 2020-11-30 选出股票数量: 3
    日期: 2020-11-30 买入: 600603.SHA
    日期: 2020-12-02 卖出2: 600603.SHA
    日期: 2020-12-02 选出股票数量: 3
    日期: 2020-12-02 买入: 002973.SZA
    日期: 2020-12-03 选出股票数量: 7
    日期: 2020-12-04 卖出2: 002973.SZA
    日期: 2020-12-07 选出股票数量: 1
    日期: 2020-12-07 买入: 603026.SHA
    日期: 2020-12-08 选出股票数量: 3
    日期: 2020-12-09 卖出2: 603026.SHA
    日期: 2020-12-15 选出股票数量: 2
    日期: 2020-12-15 买入: 002740.SZA
    日期: 2020-12-17 卖出2: 002740.SZA
    日期: 2020-12-17 选出股票数量: 2
    日期: 2020-12-17 买入: 603009.SHA
    日期: 2020-12-18 选出股票数量: 3
    日期: 2020-12-18 买入: 600506.SHA
    日期: 2020-12-21 选出股票数量: 1
    日期: 2020-12-22 卖出2: 600506.SHA
    日期: 2020-12-22 选出股票数量: 1
    日期: 2020-12-22 买入: 600107.SHA
    日期: 2020-12-24 选出股票数量: 1
    日期: 2020-12-24 买入: 600169.SHA
    日期: 2020-12-25 选出股票数量: 2
    日期: 2020-12-28 卖出2: 600169.SHA
    日期: 2020-12-28 选出股票数量: 1
    日期: 2020-12-28 买入: 603588.SHA
    日期: 2020-12-30 选出股票数量: 3
    日期: 2020-12-30 买入: 603716.SHA
    日期: 2021-01-04 卖出2: 603716.SHA
    日期: 2021-01-06 选出股票数量: 1
    日期: 2021-01-06 买入: 002789.SZA
    日期: 2021-01-08 卖出2: 002789.SZA
    日期: 2021-01-08 选出股票数量: 1
    日期: 2021-01-08 买入: 601939.SHA
    日期: 2021-01-11 选出股票数量: 1
    日期: 2021-01-12 卖出2: 601939.SHA
    日期: 2021-01-12 选出股票数量: 1
    日期: 2021-01-12 买入: 600900.SHA
    日期: 2021-01-13 选出股票数量: 2
    日期: 2021-01-14 卖出2: 600900.SHA
    日期: 2021-01-14 选出股票数量: 4
    日期: 2021-01-14 买入: 603358.SHA
    日期: 2021-01-15 选出股票数量: 10
    日期: 2021-01-18 卖出2: 603358.SHA
    日期: 2021-01-18 选出股票数量: 6
    日期: 2021-01-18 买入: 002580.SZA
    日期: 2021-01-19 选出股票数量: 6
    日期: 2021-01-20 卖出2: 002580.SZA
    日期: 2021-01-20 选出股票数量: 4
    日期: 2021-01-20 买入: 603999.SHA
    日期: 2021-01-21 选出股票数量: 1
    日期: 2021-01-22 卖出2: 603999.SHA
    日期: 2021-01-22 选出股票数量: 2
    日期: 2021-01-22 买入: 603035.SHA
    日期: 2021-01-26 卖出2: 603035.SHA
    日期: 2021-01-27 选出股票数量: 1
    日期: 2021-01-27 买入: 002690.SZA
    日期: 2021-01-29 卖出2: 002690.SZA
    日期: 2021-01-29 选出股票数量: 1
    日期: 2021-01-29 买入: 000678.SZA
    日期: 2021-02-02 卖出2: 000678.SZA
    日期: 2021-02-02 选出股票数量: 1
    日期: 2021-02-02 买入: 002262.SZA
    日期: 2021-02-03 选出股票数量: 1
    日期: 2021-02-04 卖出2: 002262.SZA
    日期: 2021-02-08 选出股票数量: 2
    日期: 2021-02-08 买入: 600500.SHA
    日期: 2021-02-09 选出股票数量: 2
    日期: 2021-02-10 卖出2: 600500.SHA
    日期: 2021-02-10 选出股票数量: 1
    日期: 2021-02-10 买入: 000573.SZA
    日期: 2021-02-19 卖出2: 000573.SZA
    日期: 2021-02-22 选出股票数量: 3
    日期: 2021-02-22 买入: 600592.SHA
    日期: 2021-02-24 卖出2: 600592.SHA
    日期: 2021-02-25 选出股票数量: 3
    日期: 2021-02-25 买入: 600886.SHA
    日期: 2021-03-01 卖出2: 600886.SHA
    日期: 2021-03-01 选出股票数量: 1
    日期: 2021-03-01 买入: 600845.SHA
    日期: 2021-03-02 选出股票数量: 2
    日期: 2021-03-02 买入: 002690.SZA
    日期: 2021-03-04 卖出2: 002690.SZA
    日期: 2021-03-10 选出股票数量: 1
    日期: 2021-03-10 买入: 600754.SHA
    日期: 2021-03-12 卖出2: 600754.SHA
    日期: 2021-03-22 选出股票数量: 2
    日期: 2021-03-22 买入: 603000.SHA
    日期: 2021-03-23 选出股票数量: 3
    日期: 2021-03-24 卖出2: 603000.SHA
    日期: 2021-03-29 选出股票数量: 1
    日期: 2021-03-29 买入: 603868.SHA
    日期: 2021-03-30 选出股票数量: 6
    日期: 2021-03-31 卖出2: 603868.SHA
    日期: 2021-04-01 选出股票数量: 1
    日期: 2021-04-01 买入: 002160.SZA
    日期: 2021-04-06 卖出2: 002160.SZA
    日期: 2021-04-06 选出股票数量: 6
    日期: 2021-04-06 买入: 002956.SZA
    日期: 2021-04-07 选出股票数量: 9
    日期: 2021-04-07 买入: 000159.SZA
    日期: 2021-04-08 选出股票数量: 13
    日期: 2021-04-09 卖出2: 000159.SZA
    日期: 2021-04-09 选出股票数量: 2
    日期: 2021-04-09 买入: 002167.SZA
    日期: 2021-04-12 选出股票数量: 1
    日期: 2021-04-12 买入: 603709.SHA
    日期: 2021-04-14 卖出2: 603709.SHA
    日期: 2021-04-14 选出股票数量: 1
    日期: 2021-04-14 买入: 603599.SHA
    日期: 2021-04-16 选出股票数量: 11
    日期: 2021-04-16 买入: 600967.SHA
    日期: 2021-04-19 选出股票数量: 2
    日期: 2021-04-20 卖出2: 600967.SHA
    日期: 2021-04-20 选出股票数量: 5
    日期: 2021-04-20 买入: 600316.SHA
    日期: 2021-04-26 选出股票数量: 2
    日期: 2021-04-26 买入: 603995.SHA
    日期: 2021-04-28 卖出2: 603995.SHA
    日期: 2021-04-29 选出股票数量: 2
    日期: 2021-04-29 买入: 002556.SZA
    日期: 2021-04-30 选出股票数量: 3
    日期: 2021-05-06 卖出2: 002556.SZA
    日期: 2021-05-06 选出股票数量: 1
    日期: 2021-05-06 买入: 600811.SHA
    日期: 2021-05-07 选出股票数量: 3
    日期: 2021-05-07 买入: 000691.SZA
    日期: 2021-05-10 选出股票数量: 5
    日期: 2021-05-11 卖出2: 000691.SZA
    日期: 2021-05-11 选出股票数量: 6
    日期: 2021-05-11 买入: 000935.SZA
    日期: 2021-05-12 选出股票数量: 5
    日期: 2021-05-12 买入: 603915.SHA
    日期: 2021-05-13 选出股票数量: 7
    日期: 2021-05-14 卖出2: 603915.SHA
    日期: 2021-05-17 选出股票数量: 1
    日期: 2021-05-17 买入: 600690.SHA
    日期: 2021-05-19 卖出2: 600690.SHA
    日期: 2021-05-20 选出股票数量: 1
    日期: 2021-05-20 买入: 000600.SZA
    日期: 2021-05-21 选出股票数量: 2
    日期: 2021-05-24 卖出2: 000600.SZA
    日期: 2021-05-24 选出股票数量: 2
    日期: 2021-05-24 买入: 600828.SHA
    日期: 2021-05-28 选出股票数量: 6
    日期: 2021-05-28 买入: 600182.SHA
    日期: 2021-05-31 选出股票数量: 1
    日期: 2021-06-01 卖出2: 600182.SHA
    日期: 2021-06-01 选出股票数量: 1
    日期: 2021-06-01 买入: 002628.SZA
    日期: 2021-06-02 选出股票数量: 7
    日期: 2021-06-03 卖出2: 002628.SZA
    日期: 2021-06-03 选出股票数量: 4
    日期: 2021-06-03 买入: 002758.SZA
    日期: 2021-06-07 卖出2: 002758.SZA
    日期: 2021-06-07 选出股票数量: 1
    日期: 2021-06-07 买入: 600649.SHA
    日期: 2021-06-08 选出股票数量: 4
    日期: 2021-06-08 买入: 002157.SZA
    日期: 2021-06-09 选出股票数量: 5
    日期: 2021-06-10 卖出2: 002157.SZA
    日期: 2021-06-10 选出股票数量: 3
    日期: 2021-06-10 买入: 600603.SHA
    日期: 2021-06-11 选出股票数量: 2
    日期: 2021-06-11 买入: 600126.SHA
    日期: 2021-06-15 选出股票数量: 2
    日期: 2021-06-16 卖出2: 600126.SHA
    日期: 2021-06-17 选出股票数量: 1
    日期: 2021-06-17 买入: 002661.SZA
    日期: 2021-06-18 选出股票数量: 2
    日期: 2021-06-21 卖出2: 002661.SZA
    日期: 2021-06-21 选出股票数量: 1
    日期: 2021-06-21 买入: 600251.SHA
    日期: 2021-06-22 选出股票数量: 3
    日期: 2021-06-22 买入: 600729.SHA
    日期: 2021-06-23 选出股票数量: 1
    日期: 2021-06-24 卖出2: 600729.SHA
    日期: 2021-06-24 选出股票数量: 5
    日期: 2021-06-24 买入: 600918.SHA
    日期: 2021-06-28 卖出2: 600918.SHA
    日期: 2021-06-28 选出股票数量: 1
    日期: 2021-06-28 买入: 600018.SHA
    日期: 2021-06-30 卖出2: 600018.SHA
    日期: 2021-06-30 选出股票数量: 3
    日期: 2021-06-30 买入: 002306.SZA
    日期: 2021-07-01 选出股票数量: 1
    日期: 2021-07-02 卖出2: 002306.SZA
    日期: 2021-07-05 选出股票数量: 2
    日期: 2021-07-05 买入: 002189.SZA
    日期: 2021-07-07 卖出2: 002189.SZA
    日期: 2021-07-07 选出股票数量: 4
    日期: 2021-07-07 买入: 002281.SZA
    日期: 2021-07-13 选出股票数量: 9
    日期: 2021-07-13 买入: 002603.SZA
    日期: 2021-07-14 选出股票数量: 1
    日期: 2021-07-15 卖出2: 002603.SZA
    日期: 2021-07-15 选出股票数量: 1
    日期: 2021-07-15 买入: 001965.SZA
    日期: 2021-07-16 选出股票数量: 1
    日期: 2021-07-19 卖出2: 001965.SZA
    日期: 2021-07-19 选出股票数量: 2
    日期: 2021-07-19 买入: 600458.SHA
    日期: 2021-07-20 选出股票数量: 1
    日期: 2021-07-21 卖出2: 600458.SHA
    日期: 2021-07-21 选出股票数量: 3
    日期: 2021-07-21 买入: 601992.SHA
    日期: 2021-07-23 卖出2: 601992.SHA
    日期: 2021-07-23 选出股票数量: 7
    日期: 2021-07-23 买入: 002797.SZA
    日期: 2021-07-27 卖出2: 002797.SZA
    日期: 2021-07-28 选出股票数量: 1
    日期: 2021-07-28 买入: 601992.SHA
    日期: 2021-07-30 卖出2: 601992.SHA
    日期: 2021-07-30 选出股票数量: 6
    日期: 2021-07-30 买入: 603912.SHA
    日期: 2021-08-03 选出股票数量: 1
    日期: 2021-08-03 买入: 600138.SHA
    日期: 2021-08-05 卖出2: 600138.SHA
    日期: 2021-08-06 选出股票数量: 1
    日期: 2021-08-06 买入: 000100.SZA
    日期: 2021-08-10 卖出2: 000100.SZA
    日期: 2021-08-12 选出股票数量: 2
    日期: 2021-08-12 买入: 600982.SHA
    日期: 2021-08-13 选出股票数量: 2
    日期: 2021-08-16 卖出2: 600982.SHA
    日期: 2021-08-16 选出股票数量: 1
    日期: 2021-08-16 买入: 000726.SZA
    日期: 2021-08-23 选出股票数量: 1
    日期: 2021-08-23 买入: 000691.SZA
    日期: 2021-08-24 选出股票数量: 1
    日期: 2021-08-25 卖出2: 000691.SZA
    日期: 2021-08-26 选出股票数量: 7
    日期: 2021-08-26 买入: 600858.SHA
    日期: 2021-08-27 选出股票数量: 2
    日期: 2021-08-30 卖出2: 600858.SHA
    日期: 2021-09-01 选出股票数量: 2
    日期: 2021-09-01 买入: 600621.SHA
    日期: 2021-09-02 选出股票数量: 1
    日期: 2021-09-02 买入: 002861.SZA
    日期: 2021-09-03 选出股票数量: 2
    日期: 2021-09-06 卖出2: 002861.SZA
    日期: 2021-09-07 选出股票数量: 1
    日期: 2021-09-07 买入: 603799.SHA
    日期: 2021-09-08 选出股票数量: 6
    日期: 2021-09-09 卖出2: 603799.SHA
    日期: 2021-09-09 选出股票数量: 1
    日期: 2021-09-09 买入: 600510.SHA
    日期: 2021-09-10 选出股票数量: 1
    日期: 2021-09-13 卖出2: 600510.SHA
    日期: 2021-09-30 选出股票数量: 2
    日期: 2021-09-30 买入: 603090.SHA
    日期: 2021-10-08 选出股票数量: 13
    日期: 2021-10-11 卖出2: 603090.SHA
    日期: 2021-10-11 选出股票数量: 5
    日期: 2021-10-11 买入: 002737.SZA
    日期: 2021-10-13 卖出2: 603090.SHA
    日期: 2021-10-14 选出股票数量: 1
    日期: 2021-10-14 买入: 601222.SHA
    日期: 2021-10-15 选出股票数量: 1
    日期: 2021-10-18 卖出2: 601222.SHA
    日期: 2021-10-18 选出股票数量: 3
    日期: 2021-10-18 买入: 002911.SZA
    日期: 2021-10-19 选出股票数量: 1
    日期: 2021-10-20 卖出2: 002911.SZA
    日期: 2021-10-20 选出股票数量: 2
    日期: 2021-10-20 买入: 605058.SHA
    日期: 2021-10-22 卖出2: 605058.SHA
    日期: 2021-10-22 选出股票数量: 2
    日期: 2021-10-22 买入: 600072.SHA
    日期: 2021-10-26 卖出2: 605058.SHA
    日期: 2021-10-26 卖出2: 600072.SHA
    日期: 2021-10-26 选出股票数量: 2
    日期: 2021-10-26 买入: 002979.SZA
    日期: 2021-10-27 选出股票数量: 1
    日期: 2021-10-28 卖出2: 002979.SZA
    日期: 2021-10-29 选出股票数量: 1
    日期: 2021-10-29 买入: 000428.SZA
    日期: 2021-11-01 选出股票数量: 4
    日期: 2021-11-02 卖出2: 000428.SZA
    日期: 2021-11-09 选出股票数量: 3
    日期: 2021-11-09 买入: 603789.SHA
    日期: 2021-11-10 选出股票数量: 13
    日期: 2021-11-11 卖出2: 603789.SHA
    日期: 2021-11-11 选出股票数量: 16
    日期: 2021-11-11 买入: 000632.SZA
    日期: 2021-11-12 选出股票数量: 11
    日期: 2021-11-12 买入: 002296.SZA
    日期: 2021-11-15 选出股票数量: 3
    日期: 2021-11-16 卖出2: 002296.SZA
    日期: 2021-11-16 选出股票数量: 8
    日期: 2021-11-16 买入: 600420.SHA
    日期: 2021-11-19 选出股票数量: 1
    日期: 2021-11-19 买入: 603329.SHA
    日期: 2021-11-23 卖出2: 603329.SHA
    日期: 2021-11-25 选出股票数量: 6
    日期: 2021-11-25 买入: 600663.SHA
    日期: 2021-11-29 卖出2: 600663.SHA
    日期: 2021-12-02 选出股票数量: 5
    日期: 2021-12-02 买入: 000736.SZA
    日期: 2021-12-06 卖出2: 000736.SZA
    日期: 2021-12-06 选出股票数量: 1
    日期: 2021-12-06 买入: 000069.SZA
    日期: 2021-12-07 选出股票数量: 1
    日期: 2021-12-07 买入: 600570.SHA
    日期: 2021-12-09 卖出2: 600570.SHA
    日期: 2021-12-09 选出股票数量: 4
    日期: 2021-12-09 买入: 600405.SHA
    日期: 2021-12-10 选出股票数量: 7
    日期: 2021-12-13 卖出2: 600405.SHA
    日期: 2021-12-13 选出股票数量: 1
    日期: 2021-12-13 买入: 002746.SZA
    日期: 2021-12-14 选出股票数量: 2
    日期: 2021-12-15 卖出2: 002746.SZA
    日期: 2021-12-15 选出股票数量: 2
    日期: 2021-12-15 买入: 600674.SHA
    日期: 2021-12-16 选出股票数量: 1
    日期: 2021-12-17 卖出2: 600674.SHA
    日期: 2021-12-20 选出股票数量: 2
    日期: 2021-12-20 买入: 000627.SZA
    日期: 2021-12-21 选出股票数量: 1
    日期: 2021-12-22 卖出2: 000627.SZA
    日期: 2021-12-22 选出股票数量: 6
    日期: 2021-12-22 买入: 003016.SZA
    日期: 2021-12-23 选出股票数量: 2
    日期: 2021-12-24 卖出2: 003016.SZA
    日期: 2021-12-24 选出股票数量: 2
    日期: 2021-12-24 买入: 002276.SZA
    日期: 2021-12-28 卖出2: 002276.SZA
    日期: 2021-12-29 选出股票数量: 4
    日期: 2021-12-29 买入: 002289.SZA
    日期: 2021-12-31 卖出2: 002289.SZA
    日期: 2021-12-31 选出股票数量: 1
    日期: 2021-12-31 买入: 601500.SHA
    
    • 收益率279.36%
    • 年化收益率99.64%
    • 基准收益率20.6%
    • 阿尔法0.97
    • 贝塔0.36
    • 夏普比率2.27
    • 胜率0.57
    • 盈亏比1.84
    • 收益波动率31.22%
    • 信息比率0.12
    • 最大回撤15.03%
    bigcharts-data-start/{"__type":"tabs","__id":"bigchart-90c9f29d1c784ab7aa79d412a6657752"}/bigcharts-data-end