{"Description":"实验创建于2018/10/16","Summary":"","Graph":{"EdgesInternal":[{"DestinationInputPortId":"-1442:instruments","SourceOutputPortId":"-25:data"},{"DestinationInputPortId":"-56:input_1","SourceOutputPortId":"-25:data"},{"DestinationInputPortId":"-1473:features","SourceOutputPortId":"-1468:data"},{"DestinationInputPortId":"-61:input_data","SourceOutputPortId":"-1473:data"},{"DestinationInputPortId":"-1442:options_data","SourceOutputPortId":"-61:data"},{"DestinationInputPortId":"-1473:input_data","SourceOutputPortId":"-56:data"},{"DestinationInputPortId":"-1442:history_ds","SourceOutputPortId":"-56:data"}],"ModuleNodes":[{"Id":"-25","ModuleId":"BigQuantSpace.instruments.instruments-v2","ModuleParameters":[{"Name":"start_date","Value":"2020-01-20 09:01:00","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"2020-02-20 15:15:00","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"market","Value":"CN_STOCK_A","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"instrument_list","Value":"600010.SHA\n000001.SZA","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"max_count","Value":0,"ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"rolling_conf","NodeId":"-25"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-25","OutputType":null}],"UsePreviousResults":false,"moduleIdForCode":2,"IsPartOfPartialRun":null,"Comment":"","CommentCollapsed":true},{"Id":"-1442","ModuleId":"BigQuantSpace.trade.trade-v4","ModuleParameters":[{"Name":"start_date","Value":"","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"initialize","Value":"# 回测引擎:初始化函数,只执行一次\ndef bigquant_run(context):\n # 设置是否是结算模式\n context.set_need_settle(False)\n context.set_commission(PerOrder(buy_cost=0.0013, sell_cost=0.0023, min_cost=5))\n","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"handle_data","Value":"# 回测引擎:每日数据处理函数,每天执行一次\ndef bigquant_run(context, data):\n instruments = context.instruments\n \n # 获取当前分钟的买卖信号\n today_date=data.current_dt.strftime('%Y-%m-%d %H:%M:%S')\n time = data.current_dt.strftime('%H:%M')\n if context.index < 6: # 日内分钟计数器超过计算窗口后才开始交易\n context.index += 1\n return\n \n conditions = context.condition[context.condition.date==today_date] # 获取最新信号\n \n for instrument in instruments:\n instrument_symbol = context.symbol(instrument) # 交易标的\n curr_position = context.portfolio.positions[instrument_symbol].amount # 持仓数量\n \n try:\n buy_condition = conditions[conditions.instrument==instrument]['buy_condition'].values[0]\n except:\n buy_condition = 0\n \n try:\n daily_close_1 = conditions[conditions.instrument==instrument]['daily_close_1'].values[0]\n new_price = data.current(instrument_symbol, ['price'])\n sell_condition = 1 if new_price['price'] > daily_close_1*1.04 else 0\n except:\n sell_condition = 0 \n \n # 如果当前没有仓位且满足买入条件,执行开仓\n if curr_position == 0 and buy_condition>0 and time<\"14:56\":\n context.order_target(instrument_symbol, 100)\n elif curr_position >= 0 and (sell_condition>0 or time=='14:57'):\n context.order_target(instrument_symbol, 0)","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"prepare","Value":"# 回测引擎:准备数据,只执行一次\ndef bigquant_run(context):\n df = context.options['data'].read_df()\n df['date']=df['date'].apply(lambda x:x.strftime('%Y-%m-%d %H:%M:%S'))\n context.condition=df\n\n","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"before_trading_start","Value":"# 回测引擎:每个单位时间开始前调用一次,即每日开盘前调用一次。\ndef bigquant_run(context, data):\n # 当日分钟K线数量记录变量初始化\n context.index = 1\n","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"volume_limit","Value":"0","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"order_price_field_buy","Value":"open","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"order_price_field_sell","Value":"open","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"capital_base","Value":"500001","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"auto_cancel_non_tradable_orders","Value":"True","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"data_frequency","Value":"minute","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"price_type","Value":"真实价格","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"product_type","Value":"股票","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"plot_charts","Value":"True","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"backtest_only","Value":"False","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"benchmark","Value":"000300.HIX","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"instruments","NodeId":"-1442"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"options_data","NodeId":"-1442"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"history_ds","NodeId":"-1442"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"benchmark_ds","NodeId":"-1442"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"trading_calendar","NodeId":"-1442"}],"OutputPortsInternal":[{"Name":"raw_perf","NodeId":"-1442","OutputType":null}],"UsePreviousResults":false,"moduleIdForCode":3,"IsPartOfPartialRun":null,"Comment":"","CommentCollapsed":true},{"Id":"-1468","ModuleId":"BigQuantSpace.input_features.input_features-v1","ModuleParameters":[{"Name":"features","Value":"\n# #号开始的表示注释\n# 多个特征,每行一个,可以包含基础特征和衍生特征\nbuy_condition=where(close>=ts_max(close,5),1,0)\n","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features_ds","NodeId":"-1468"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-1468","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":5,"IsPartOfPartialRun":null,"Comment":"","CommentCollapsed":true},{"Id":"-1473","ModuleId":"BigQuantSpace.derived_feature_extractor.derived_feature_extractor-v3","ModuleParameters":[{"Name":"date_col","Value":"date","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"instrument_col","Value":"instrument","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"drop_na","Value":"False","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"remove_extra_columns","Value":"False","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"user_functions","Value":"{}","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_data","NodeId":"-1473"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features","NodeId":"-1473"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-1473","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":6,"IsPartOfPartialRun":null,"Comment":"","CommentCollapsed":true},{"Id":"-61","ModuleId":"BigQuantSpace.dropnan.dropnan-v2","ModuleParameters":[],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_data","NodeId":"-61"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features","NodeId":"-61"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-61","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":1,"IsPartOfPartialRun":null,"Comment":"","CommentCollapsed":true},{"Id":"-56","ModuleId":"BigQuantSpace.extract_minute_daily.extract_minute_daily-v3","ModuleParameters":[{"Name":"features","Value":"[\"daily_close_1=close_1/adjust_factor_1\", \"adjust_factor=adjust_factor_0\"]","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"before_days","Value":10,"ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_1","NodeId":"-56"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-56","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":7,"IsPartOfPartialRun":null,"Comment":"","CommentCollapsed":true}],"SerializedClientData":"<?xml version='1.0' encoding='utf-16'?><DataV1 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><Meta /><NodePositions><NodePosition Node='-25' Position='9,22,200,200'/><NodePosition Node='-1442' Position='158,434.9627685546875,200,200'/><NodePosition Node='-1468' Position='395,20,200,200'/><NodePosition Node='-1473' Position='398,232,200,200'/><NodePosition Node='-61' Position='397,313,200,200'/><NodePosition Node='-56' Position='116.61395263671875,130.03721618652344,200,200'/></NodePositions><NodeGroups /></DataV1>"},"IsDraft":true,"ParentExperimentId":null,"WebService":{"IsWebServiceExperiment":false,"Inputs":[],"Outputs":[],"Parameters":[{"Name":"交易日期","Value":"","ParameterDefinition":{"Name":"交易日期","FriendlyName":"交易日期","DefaultValue":"","ParameterType":"String","HasDefaultValue":true,"IsOptional":true,"ParameterRules":[],"HasRules":false,"MarkupType":0,"CredentialDescriptor":null}}],"WebServiceGroupId":null,"SerializedClientData":"<?xml version='1.0' encoding='utf-16'?><DataV1 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><Meta /><NodePositions></NodePositions><NodeGroups /></DataV1>"},"DisableNodesUpdate":false,"Category":"user","Tags":[],"IsPartialRun":true}
[2021-01-14 16:22:49.719510] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-01-14 16:22:49.744352] INFO: moduleinvoker: instruments.v2 运行完成[0.02482s].
[2021-01-14 16:22:49.746234] INFO: moduleinvoker: extract_minute_daily.v3 开始运行..
[2021-01-14 16:22:50.445420] INFO: moduleinvoker: input_features.v1 开始运行..
[2021-01-14 16:22:50.479172] INFO: moduleinvoker: input_features.v1 运行完成[0.033769s].
[2021-01-14 16:22:50.480670] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-01-14 16:22:50.508193] INFO: moduleinvoker: instruments.v2 运行完成[0.027511s].
[2021-01-14 16:22:50.516493] INFO: moduleinvoker: general_feature_extractor.v7 开始运行..
[2021-01-14 16:22:51.038154] INFO: 基础特征抽取: 年份 2020, 特征行数=48
[2021-01-14 16:22:51.090588] INFO: 基础特征抽取: 总行数: 48
[2021-01-14 16:22:51.093622] INFO: moduleinvoker: general_feature_extractor.v7 运行完成[0.577147s].
[2021-01-14 16:22:51.094969] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2021-01-14 16:22:51.122530] INFO: derived_feature_extractor: 提取完成 daily_close_1=close_1/adjust_factor_1, 0.001s
[2021-01-14 16:22:51.124276] INFO: derived_feature_extractor: 提取完成 adjust_factor=adjust_factor_0, 0.000s
[2021-01-14 16:22:51.148395] INFO: derived_feature_extractor: /y_2020, 48
[2021-01-14 16:22:51.200444] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[0.105457s].
[2021-01-14 16:22:51.487283] INFO: moduleinvoker: extract_minute_daily.v3 运行完成[1.741028s].
[2021-01-14 16:22:51.489122] INFO: moduleinvoker: input_features.v1 开始运行..
[2021-01-14 16:22:51.494038] INFO: moduleinvoker: 命中缓存
[2021-01-14 16:22:51.494876] INFO: moduleinvoker: input_features.v1 运行完成[0.005754s].
[2021-01-14 16:22:51.496193] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2021-01-14 16:22:51.592193] INFO: derived_feature_extractor: 提取完成 buy_condition=where(close>=ts_max(close,5),1,0), 0.007s
[2021-01-14 16:22:51.624703] INFO: derived_feature_extractor: /data, 8640
[2021-01-14 16:22:51.679386] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[0.183168s].
[2021-01-14 16:22:51.681129] INFO: moduleinvoker: dropnan.v2 开始运行..
[2021-01-14 16:22:51.751751] INFO: dropnan: /data, 8640/8640
[2021-01-14 16:22:51.885808] INFO: dropnan: 行数: 8640/8640
[2021-01-14 16:22:51.889199] INFO: moduleinvoker: dropnan.v2 运行完成[0.208056s].
[2021-01-14 16:22:51.928457] INFO: moduleinvoker: backtest.v8 开始运行..
[2021-01-14 16:22:51.939906] INFO: backtest: biglearning backtest:V8.4.2
[2021-01-14 16:22:52.023082] INFO: backtest: product_type:stock by specified
[2021-01-14 16:22:52.152116] INFO: algo: TradingAlgorithm V1.7.0
[2021-01-14 16:22:52.313317] INFO: algo: trading transform...
[2021-01-14 16:23:13.190077] INFO: Performance: Simulated 18 trading days out of 18.
[2021-01-14 16:23:13.191177] INFO: Performance: first open: 2020-01-20 09:30:00+00:00
[2021-01-14 16:23:13.192112] INFO: Performance: last close: 2020-02-20 15:00:00+00:00
[2021-01-14 16:23:18.034419] INFO: moduleinvoker: backtest.v8 运行完成[26.105948s].
[2021-01-14 16:23:18.035998] INFO: moduleinvoker: trade.v4 运行完成[26.145307s].
- 收益率-0.02%
- 年化收益率-0.25%
- 基准收益率-0.25%
- 阿尔法-0.03
- 贝塔0.0
- 夏普比率-34.44
- 胜率0.56
- 盈亏比1.15
- 收益波动率0.09%
- 信息比率-0.01
- 最大回撤0.03%
bigcharts-data-start/{"__type":"tabs","__id":"bigchart-2e62720ee0cd4468b58896df13a1b7bb"}/bigcharts-data-end