{"Description":"实验创建于2020/10/29","Summary":"","Graph":{"EdgesInternal":[{"DestinationInputPortId":"-152:instruments","SourceOutputPortId":"-140:data"}],"ModuleNodes":[{"Id":"-140","ModuleId":"BigQuantSpace.instruments.instruments-v2","ModuleParameters":[{"Name":"start_date","Value":"2016-06-28","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"2016-07-18","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"market","Value":"CN_STOCK_A","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"instrument_list","Value":"600000.SHA\n000002.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":"-140"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-140","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":1,"IsPartOfPartialRun":null,"Comment":"","CommentCollapsed":true},{"Id":"-152","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 pass","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"handle_data","Value":"# 回测引擎:每日数据处理函数,每天执行一次\ndef bigquant_run(context, data):\n \n dt = data.current_dt.strftime('%Y-%m-%d')\n k = context.instruments[0] # 标的为字符串格式\n sid = context.symbol(k) # 将标的转化为equity格式\n \n if dt == '2016-07-13':\n order(sid, 100)\n print(dt,'生成一个买入100股的虚拟订单')\n ","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 \n dt = data.current_dt.strftime('%Y-%m-%d')\n \n k = context.instruments[0] # 标的为字符串格式\n \n sid = context.symbol(k) # 将标的转化为equity格式\n \n print('撤单之前的委托:', context.get_open_orders().values())\n \n for open_orders in context.get_open_orders().values():\n\n \n for order in open_orders:\n \n sid = order.sid\n today_open = data.current(sid, 'open')\n \n if True: \n context.cancel_order(order)\n print(dt,'在before_trading_start取消订单:',sid)\n print('撤单之后的委托:',context.get_open_orders().values())\n \n # 买入另外一只\n from zipline.finance.order import Order\n from zipline.finance.execution import MarketOrder\n \n order = Order(\n dt = order['dt'],\n asset=context.symbol(context.instruments[1]),\n amount=100,\n stop=None,\n limit=None,\n price_field='open')\n \n try:\n context.blotter.open_orders[order.asset].append(order)\n except Exception:\n context.blotter.open_orders[order.asset] = [order]\n\n context.blotter.orders[order.id] = order\n context.blotter.new_orders.append(order)\n continue\n \n print('新提交订单后的委托:',context.get_open_orders().values())\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":"open","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":"","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"instruments","NodeId":"-152"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"options_data","NodeId":"-152"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"history_ds","NodeId":"-152"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"benchmark_ds","NodeId":"-152"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"trading_calendar","NodeId":"-152"}],"OutputPortsInternal":[{"Name":"raw_perf","NodeId":"-152","OutputType":null}],"UsePreviousResults":false,"moduleIdForCode":2,"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='-140' Position='225,157,200,200'/><NodePosition Node='-152' Position='185,341,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":false}
[2022-12-13 16:10:19.074728] INFO: moduleinvoker: instruments.v2 开始运行..
[2022-12-13 16:10:19.092515] INFO: moduleinvoker: 命中缓存
[2022-12-13 16:10:19.094915] INFO: moduleinvoker: instruments.v2 运行完成[0.020204s].
[2022-12-13 16:10:24.735585] INFO: moduleinvoker: backtest.v8 开始运行..
[2022-12-13 16:10:24.745438] INFO: moduleinvoker: 命中缓存
[2022-12-13 16:10:26.072765] INFO: moduleinvoker: backtest.v8 运行完成[1.337169s].
[2022-12-13 16:10:26.075751] INFO: moduleinvoker: trade.v4 运行完成[6.958896s].
- 收益率-0.01%
- 年化收益率-0.14%
- 基准收益率4.53%
- 阿尔法-0.03
- 贝塔0.0
- 夏普比率-148.04
- 胜率0.0
- 盈亏比0.0
- 收益波动率0.02%
- 信息比率-0.41
- 最大回撤0.01%
bigcharts-data-start/{"__type":"tabs","__id":"bigchart-6e95d86617a74051bac4ea6bb72134ca"}/bigcharts-data-end