克隆策略

    {"Description":"实验创建于2017/8/26","Summary":"","Graph":{"EdgesInternal":[{"DestinationInputPortId":"-162:instruments","SourceOutputPortId":"287d2cb0-f53c-4101-bdf8-104b137c8601-8:data"},{"DestinationInputPortId":"-162:features","SourceOutputPortId":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"DestinationInputPortId":"-169:input_data","SourceOutputPortId":"-162:data"},{"DestinationInputPortId":"-40:input_ds","SourceOutputPortId":"-169:data"},{"DestinationInputPortId":"-169:features","SourceOutputPortId":"-177:data"},{"DestinationInputPortId":"-59:input_ds","SourceOutputPortId":"-40:data"},{"DestinationInputPortId":"-117:input_ds","SourceOutputPortId":"-40:data"}],"ModuleNodes":[{"Id":"287d2cb0-f53c-4101-bdf8-104b137c8601-8","ModuleId":"BigQuantSpace.instruments.instruments-v2","ModuleParameters":[{"Name":"start_date","Value":"2015-01-01","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"2015-12-01","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"market","Value":"CN_STOCK_A","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"instrument_list","Value":"000001.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":"287d2cb0-f53c-4101-bdf8-104b137c8601-8"}],"OutputPortsInternal":[{"Name":"data","NodeId":"287d2cb0-f53c-4101-bdf8-104b137c8601-8","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":1,"Comment":"","CommentCollapsed":true},{"Id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24","ModuleId":"BigQuantSpace.input_features.input_features-v1","ModuleParameters":[{"Name":"features","Value":"# #号开始的表示注释\n# 多个特征,每行一个,可以包含基础特征和衍生特征\nlow\nhigh\nclose\nopen\nadjust_factor\namount","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features_ds","NodeId":"287d2cb0-f53c-4101-bdf8-104b137c8601-24"}],"OutputPortsInternal":[{"Name":"data","NodeId":"287d2cb0-f53c-4101-bdf8-104b137c8601-24","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":3,"Comment":"","CommentCollapsed":true},{"Id":"-162","ModuleId":"BigQuantSpace.use_datasource.use_datasource-v1","ModuleParameters":[{"Name":"datasource_id","Value":"bar1d_CN_STOCK_A","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"start_date","Value":"","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"instruments","NodeId":"-162"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features","NodeId":"-162"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-162","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":2,"Comment":"","CommentCollapsed":true},{"Id":"-169","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":"True","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"user_functions","Value":"{}","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_data","NodeId":"-169"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features","NodeId":"-169"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-169","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":6,"Comment":"","CommentCollapsed":true},{"Id":"-177","ModuleId":"BigQuantSpace.input_features.input_features-v1","ModuleParameters":[{"Name":"features","Value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\namount\nopen/adjust_factor\nclose/adjust_factor\nhigh/adjust_factor\nlow/adjust_factor","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features_ds","NodeId":"-177"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-177","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":7,"Comment":"","CommentCollapsed":true},{"Id":"-40","ModuleId":"BigQuantSpace.rename_columns.rename_columns-v5","ModuleParameters":[{"Name":"columns","Value":"open/adjust_factor:open|close/adjust_factor:close|high/adjust_factor:high|low/adjust_factor:low","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"keep_old_columns","Value":"False","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_ds","NodeId":"-40"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-40","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":5,"Comment":"","CommentCollapsed":true},{"Id":"-59","ModuleId":"BigQuantSpace.Tplot.Tplot-v1","ModuleParameters":[{"Name":"x","Value":"date","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"y","Value":"open","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"title","Value":"开盘价折线图","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"chart_type","Value":"spline","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"chart_options","Value":"{'chart':{'height': 500}}","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_ds","NodeId":"-59"}],"OutputPortsInternal":[],"UsePreviousResults":true,"moduleIdForCode":10,"Comment":"绘制开盘价折线图","CommentCollapsed":false},{"Id":"-117","ModuleId":"BigQuantSpace.Tplot.Tplot-v1","ModuleParameters":[{"Name":"x","Value":"date","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"y","Value":"open,high,low,close,amount","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"title","Value":"K线图","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"chart_type","Value":"candlestick","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"chart_options","Value":"{'series': [{},{'type': 'column'}]}","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_ds","NodeId":"-117"}],"OutputPortsInternal":[],"UsePreviousResults":true,"moduleIdForCode":4,"Comment":"绘制K线图","CommentCollapsed":false}],"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='287d2cb0-f53c-4101-bdf8-104b137c8601-8' Position='211,64,200,200'/><NodePosition Node='287d2cb0-f53c-4101-bdf8-104b137c8601-24' Position='556,68,200,200'/><NodePosition Node='-162' Position='371,178,200,200'/><NodePosition Node='-169' Position='447,277,200,200'/><NodePosition Node='-177' Position='675,175,200,200'/><NodePosition Node='-40' Position='455,357,200,200'/><NodePosition Node='-59' Position='172.43206787109375,469.0449523925781,200,200'/><NodePosition Node='-117' Position='516.7000122070312,469.035400390625,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}
    In [6]:
    # 本代码由可视化策略环境自动生成 2019年1月31日 14:49
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    m1 = M.instruments.v2(
        start_date='2015-01-01',
        end_date='2015-12-01',
        market='CN_STOCK_A',
        instrument_list='000001.SZA',
        max_count=0
    )
    
    m3 = M.input_features.v1(
        features="""# #号开始的表示注释
    # 多个特征,每行一个,可以包含基础特征和衍生特征
    low
    high
    close
    open
    adjust_factor
    amount"""
    )
    
    m2 = M.use_datasource.v1(
        instruments=m1.data,
        features=m3.data,
        datasource_id='bar1d_CN_STOCK_A',
        start_date='',
        end_date=''
    )
    
    m7 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    amount
    open/adjust_factor
    close/adjust_factor
    high/adjust_factor
    low/adjust_factor"""
    )
    
    m6 = M.derived_feature_extractor.v3(
        input_data=m2.data,
        features=m7.data,
        date_col='date',
        instrument_col='instrument',
        drop_na=False,
        remove_extra_columns=True,
        user_functions={}
    )
    
    m5 = M.rename_columns.v5(
        input_ds=m6.data,
        columns='open/adjust_factor:open|close/adjust_factor:close|high/adjust_factor:high|low/adjust_factor:low',
        keep_old_columns=False
    )
    
    m10 = M.Tplot.v1(
        input_ds=m5.data,
        x='date',
        y='open',
        title='开盘价折线图',
        chart_type='spline',
        chart_options={'chart':{'height': 500}}
    )
    
    m4 = M.Tplot.v1(
        input_ds=m5.data,
        x='date',
        y='open,high,low,close,amount',
        title='K线图',
        chart_type='candlestick',
        chart_options={'series': [{},{'type': 'column'}]}
    )
    
    [2019-01-31 13:40:50.024151] INFO: bigquant: instruments.v2 开始运行..
    [2019-01-31 13:40:50.029349] INFO: bigquant: 命中缓存
    [2019-01-31 13:40:50.030362] INFO: bigquant: instruments.v2 运行完成[0.006255s].
    [2019-01-31 13:40:50.034420] INFO: bigquant: input_features.v1 开始运行..
    [2019-01-31 13:40:50.038951] INFO: bigquant: 命中缓存
    [2019-01-31 13:40:50.039848] INFO: bigquant: input_features.v1 运行完成[0.005453s].
    [2019-01-31 13:40:50.046996] INFO: bigquant: use_datasource.v1 开始运行..
    [2019-01-31 13:40:50.053149] INFO: bigquant: 命中缓存
    [2019-01-31 13:40:50.054260] INFO: bigquant: use_datasource.v1 运行完成[0.007272s].
    [2019-01-31 13:40:50.057194] INFO: bigquant: input_features.v1 开始运行..
    [2019-01-31 13:40:50.062633] INFO: bigquant: 命中缓存
    [2019-01-31 13:40:50.063664] INFO: bigquant: input_features.v1 运行完成[0.006473s].
    [2019-01-31 13:40:50.107448] INFO: bigquant: derived_feature_extractor.v3 开始运行..
    [2019-01-31 13:40:50.113660] INFO: bigquant: 命中缓存
    [2019-01-31 13:40:50.114664] INFO: bigquant: derived_feature_extractor.v3 运行完成[0.007271s].
    [2019-01-31 13:40:50.118041] INFO: bigquant: rename_columns.v5 开始运行..
    [2019-01-31 13:40:50.123295] INFO: bigquant: 命中缓存
    [2019-01-31 13:40:50.124446] INFO: bigquant: rename_columns.v5 运行完成[0.006402s].
    [2019-01-31 13:40:50.128129] INFO: bigquant: Tplot.v1 开始运行..
    [2019-01-31 13:40:50.144940] INFO: bigquant: 命中缓存
    
    [2019-01-31 13:40:50.187813] INFO: bigquant: Tplot.v1 运行完成[0.059642s].
    [2019-01-31 13:40:50.191295] INFO: bigquant: Tplot.v1 开始运行..
    
    [2019-01-31 13:40:50.736915] INFO: bigquant: Tplot.v1 运行完成[0.545587s].