{"description":"实验创建于2021/10/9","graph":{"edges":[{"to_node_id":"-60:instruments","from_node_id":"-44:data"},{"to_node_id":"-5527:instruments","from_node_id":"-44:data"},{"to_node_id":"-5527:history_ds","from_node_id":"-60:data"}],"nodes":[{"node_id":"-44","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2015-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2021-10-10","type":"Literal","bound_global_parameter":null},{"name":"market","value":"CN_FUND","type":"Literal","bound_global_parameter":null},{"name":"instrument_list","value":"#日经\n513520.HOF\n#德国指数\n513030.HOF\n#纳斯达克\n159941.ZOF\n#黄金\n518880.HOF\n#恒生\n159920.ZOF\n#沪深300\n510300.HOF\n#国债\n511010.HOF","type":"Literal","bound_global_parameter":null},{"name":"max_count","value":0,"type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"rolling_conf","node_id":"-44"}],"output_ports":[{"name":"data","node_id":"-44"}],"cacheable":true,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"-60","module_id":"BigQuantSpace.use_datasource.use_datasource-v1","parameters":[{"name":"datasource_id","value":"bar1d_CN_FUND","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":"-60"},{"name":"features","node_id":"-60"}],"output_ports":[{"name":"data","node_id":"-60"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true},{"node_id":"-5527","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 #context.ranker_prediction = context.options['data'].read_df()\n\n # 系统已经设置了默认的交易手续费和滑点,要修改手续费可使用如下函数\n context.set_commission(PerOrder(buy_cost=0.00015, sell_cost=0.00015, min_cost=0))\n #国债放大持有仓位倍数\n context.DEBT = 4\n #每标的购买资金\n context.max_cash_per_instrument = context.portfolio.portfolio_value/(len(context.instruments)-1+context.DEBT)\n","type":"Literal","bound_global_parameter":null},{"name":"handle_data","value":"# 回测引擎:每日数据处理函数,每天执行一次\ndef bigquant_run(context, data):\n \n today = data.current_dt.strftime('%Y-%m-%d')\n # 获取当前持仓\n positions = {e.symbol: p.amount for e, p in context.portfolio.positions.items()}\n #买入并持有\n #每标的购买资金\n for instrument in context.instruments:\n if instrument not in positions.keys():\n cash = context.max_cash_per_instrument\n if instrument=='511010.HOF':\n cash = context.max_cash_per_instrument * context.DEBT\n context.order_value(context.symbol(instrument), cash)\n \n \n \n \n\n \n ","type":"Literal","bound_global_parameter":null},{"name":"prepare","value":"# 回测引擎:准备数据,只执行一次\ndef bigquant_run(context):\n pass\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":1000000,"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":"-5527"},{"name":"options_data","node_id":"-5527"},{"name":"history_ds","node_id":"-5527"},{"name":"benchmark_ds","node_id":"-5527"},{"name":"trading_calendar","node_id":"-5527"}],"output_ports":[{"name":"raw_perf","node_id":"-5527"}],"cacheable":false,"seq_num":4,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-44' Position='-39.946388244628906,86.71751403808594,200,200'/><node_position Node='-60' Position='-34.96495056152344,208.92578125,200,200'/><node_position Node='-5527' Position='-99.11338937282562,331.4907531738281,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
[2021-11-11 21:49:42.710674] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-11-11 21:49:42.724898] INFO: moduleinvoker: 命中缓存
[2021-11-11 21:49:42.726562] INFO: moduleinvoker: instruments.v2 运行完成[0.015897s].
[2021-11-11 21:49:42.732642] INFO: moduleinvoker: use_datasource.v1 开始运行..
[2021-11-11 21:49:42.741787] INFO: moduleinvoker: 命中缓存
[2021-11-11 21:49:42.743386] INFO: moduleinvoker: use_datasource.v1 运行完成[0.010781s].
[2021-11-11 21:49:42.815087] INFO: moduleinvoker: backtest.v8 开始运行..
[2021-11-11 21:49:42.819661] INFO: backtest: biglearning backtest:V8.5.0
[2021-11-11 21:49:42.821002] INFO: backtest: product_type:stock by specified
[2021-11-11 21:49:43.036745] INFO: algo: TradingAlgorithm V1.8.5
[2021-11-11 21:49:44.297178] INFO: algo: trading transform...
[2021-11-11 21:49:52.416687] INFO: Performance: Simulated 1645 trading days out of 1645.
[2021-11-11 21:49:52.418377] INFO: Performance: first open: 2015-01-05 09:30:00+00:00
[2021-11-11 21:49:52.419837] INFO: Performance: last close: 2021-10-08 15:00:00+00:00
[2021-11-11 21:49:56.618184] INFO: moduleinvoker: backtest.v8 运行完成[13.803088s].
[2021-11-11 21:49:56.619983] INFO: moduleinvoker: trade.v4 运行完成[13.870718s].
- 收益率45.04%
- 年化收益率5.86%
- 基准收益率39.51%
- 阿尔法0.02
- 贝塔0.21
- 夏普比率0.42
- 胜率1.0
- 盈亏比0.0
- 收益波动率7.05%
- 信息比率-0.01
- 最大回撤12.23%
bigcharts-data-start/{"__type":"tabs","__id":"bigchart-cb3f23278e2b4595a90676b139761d62"}/bigcharts-data-end