{"Description":"实验创建于2021/3/24","Summary":"","Graph":{"EdgesInternal":[{"DestinationInputPortId":"-157:history_ds","SourceOutputPortId":"-130:data"},{"DestinationInputPortId":"-157:instruments","SourceOutputPortId":"-145:data"}],"ModuleNodes":[{"Id":"-130","ModuleId":"BigQuantSpace.input_csv.input_csv-v5","ModuleParameters":[{"Name":"file","Value":"/home/bigquant/work/userlib/data.csv","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"coding","Value":"utf8","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"dtypes","Value":"{}","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"date_type","Value":"%Y-%m-%d","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"date_cols","Value":"['date']","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[],"OutputPortsInternal":[{"Name":"data","NodeId":"-130","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":1,"Comment":"自定义行情数据","CommentCollapsed":false},{"Id":"-145","ModuleId":"BigQuantSpace.instruments.instruments-v2","ModuleParameters":[{"Name":"start_date","Value":"2020-01-01","ValueType":"Literal","LinkedGlobalParameter":"交易日期"},{"Name":"end_date","Value":"2020-03-01","ValueType":"Literal","LinkedGlobalParameter":"交易日期"},{"Name":"market","Value":"CN_STOCK_A","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"instrument_list","Value":"","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"max_count","Value":0,"ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"rolling_conf","NodeId":"-145"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-145","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":2,"Comment":"","CommentCollapsed":true},{"Id":"-157","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 context.set_commission(PerOrder(buy_cost=0.0003, sell_cost=0.0013, min_cost=5))\n","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"handle_data","Value":"# 回测引擎:每日数据处理函数,每天执行一次\ndef bigquant_run(context, data):\n # 按日期过滤得到今日的预测数据\n buy_instruments = context.instruments[:5]\n cash = context.portfolio.cash\n value = context.portfolio.positions_value\n positions = {e.symbol: v.amount * v.cost_basis for e,v in context.portfolio.positions.items()}\n for i, instrument in enumerate(buy_instruments):\n if cash < value and positions.get(instrument,0) > 0:\n context.order_target(instrument,0)\n cash += positions[instrument]\n elif cash > value and positions.get(instrument,0) == 0:\n buy_cash = (cash - value)/5\n context.order_value(instrument,buy_cash)","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"prepare","Value":"# 回测引擎:准备数据,只执行一次\ndef bigquant_run(context):\n pass\n","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"before_trading_start","Value":"# 回测引擎:每个单位时间开始前调用一次,即每日开盘前调用一次。\ndef bigquant_run(context, data):\n pass\n","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"volume_limit","Value":0.025,"ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"order_price_field_buy","Value":"open","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"order_price_field_sell","Value":"close","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"capital_base","Value":1000000,"ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"auto_cancel_non_tradable_orders","Value":"True","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"data_frequency","Value":"daily","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":"-157"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"options_data","NodeId":"-157"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"history_ds","NodeId":"-157"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"benchmark_ds","NodeId":"-157"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"trading_calendar","NodeId":"-157"}],"OutputPortsInternal":[{"Name":"raw_perf","NodeId":"-157","OutputType":null}],"UsePreviousResults":false,"moduleIdForCode":3,"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='-130' Position='325,127.203125,200,200'/><NodePosition Node='-145' Position='14,127.203125,200,200'/><NodePosition Node='-157' Position='206,288.203125,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-03-24 16:38:58.509654] INFO: moduleinvoker: input_csv.v5 开始运行..
[2021-03-24 16:38:58.516215] INFO: moduleinvoker: 命中缓存
[2021-03-24 16:38:58.517610] INFO: moduleinvoker: input_csv.v5 运行完成[0.007971s].
[2021-03-24 16:38:58.519689] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-03-24 16:38:58.524203] INFO: moduleinvoker: 命中缓存
[2021-03-24 16:38:58.525219] INFO: moduleinvoker: instruments.v2 运行完成[0.005528s].
[2021-03-24 16:38:58.576283] INFO: moduleinvoker: backtest.v8 开始运行..
[2021-03-24 16:38:58.581191] INFO: backtest: biglearning backtest:V8.5.0
[2021-03-24 16:38:58.582126] INFO: backtest: product_type:stock by specified
[2021-03-24 16:38:58.731551] INFO: algo: TradingAlgorithm V1.8.1
[2021-03-24 16:38:58.804925] INFO: algo: trading transform...
[2021-03-24 16:38:58.978992] INFO: Performance: Simulated 36 trading days out of 36.
[2021-03-24 16:38:58.980452] INFO: Performance: first open: 2020-01-02 09:30:00+00:00
[2021-03-24 16:38:58.981444] INFO: Performance: last close: 2020-02-28 15:00:00+00:00
[2021-03-24 16:38:59.764753] INFO: moduleinvoker: backtest.v8 运行完成[1.188461s].
[2021-03-24 16:38:59.766129] INFO: moduleinvoker: trade.v4 运行完成[1.238877s].
- 收益率5.45%
- 年化收益率44.99%
- 基准收益率-3.82%
- 阿尔法0.46
- 贝塔0.41
- 夏普比率1.94
- 胜率0.67
- 盈亏比0.2
- 收益波动率18.5%
- 信息比率0.17
- 最大回撤7.63%
bigcharts-data-start/{"__type":"tabs","__id":"bigchart-19ac0bf035da472887e0bd8b8fcf3a8c"}/bigcharts-data-end