平台北上资金数据好像不全

策略分享
标签: #<Tag:0x00007fcf639447f8>

(donkyxote) #1
克隆策略

    {"Description":"实验创建于2020/9/28","Summary":"","Graph":{"EdgesInternal":[{"DestinationInputPortId":"-920:input_data","SourceOutputPortId":"-160:data"},{"DestinationInputPortId":"-160:features","SourceOutputPortId":"-166:data"},{"DestinationInputPortId":"-277:input_ds","SourceOutputPortId":"-920:data"},{"DestinationInputPortId":"-920:features","SourceOutputPortId":"-928:data"}],"ModuleNodes":[{"Id":"-160","ModuleId":"BigQuantSpace.use_datasource.use_datasource-v1","ModuleParameters":[{"Name":"datasource_id","Value":"shgt_zhangfubang_hs","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"start_date","Value":"2020-09-01","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"2020-09-28","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"instruments","NodeId":"-160"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features","NodeId":"-160"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-160","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":1,"Comment":"","CommentCollapsed":true},{"Id":"-166","ModuleId":"BigQuantSpace.input_features.input_features-v1","ModuleParameters":[{"Name":"features","Value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\ndate\ninstrument\n#name\n#list_date\namount \t\n#chg_5m \t\n#chg_amount \t\n#date \t\n#high \t\n#higher_speed \t\t\n#low \t\n#market_cap \n#pct_chg \t\n#pct_chg_60d \t\n#pct_chg_year_now \t\n#pe \t\n#pre_close \t\n#price \t \t\n#swing \t\n#turn \t\nvolume\n#close\n#close_0\n#open_0\n#jmje\n#open_1","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features_ds","NodeId":"-166"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-166","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":2,"Comment":"","CommentCollapsed":true},{"Id":"-920","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":"-920"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features","NodeId":"-920"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-920","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":3,"Comment":"","CommentCollapsed":true},{"Id":"-928","ModuleId":"BigQuantSpace.input_features.input_features-v1","ModuleParameters":[{"Name":"features","Value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nnorth_amount = amount/volume","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features_ds","NodeId":"-928"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-928","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":4,"Comment":"","CommentCollapsed":true},{"Id":"-277","ModuleId":"BigQuantSpace.select_columns.select_columns-v3","ModuleParameters":[{"Name":"columns","Value":"north_amount,instrument","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"reverse_select","Value":"True","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_ds","NodeId":"-277"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"columns_ds","NodeId":"-277"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-277","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":5,"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='-160' Position='308,268,200,200'/><NodePosition Node='-166' Position='331,-38,200,200'/><NodePosition Node='-920' Position='417,416,200,200'/><NodePosition Node='-928' Position='668,113,200,200'/><NodePosition Node='-277' Position='528,551,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 [ ]:
    # 本代码由可视化策略环境自动生成 2020年9月30日 09:48
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    m2 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    date
    instrument
    #name
    #list_date
    amount 	
    #chg_5m 	
    #chg_amount 	
    #date 	
    #high 	
    #higher_speed 		
    #low 	
    #market_cap 
    #pct_chg 	
    #pct_chg_60d 	
    #pct_chg_year_now 	
    #pe 	
    #pre_close 	
    #price 	 	
    #swing 	
    #turn 	
    volume
    #close
    #close_0
    #open_0
    #jmje
    #open_1"""
    )
    
    m1 = M.use_datasource.v1(
        features=m2.data,
        datasource_id='shgt_zhangfubang_hs',
        start_date='2020-09-01',
        end_date='2020-09-28'
    )
    
    m4 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    north_amount = amount/volume"""
    )
    
    m3 = M.derived_feature_extractor.v3(
        input_data=m1.data,
        features=m4.data,
        date_col='date',
        instrument_col='instrument',
        drop_na=False,
        remove_extra_columns=False,
        user_functions={}
    )
    
    m5 = M.select_columns.v3(
        input_ds=m3.data,
        columns='north_amount,instrument',
        reverse_select=True
    )