宽基ETF的日线数据取不出来???另外数据源是不是必须要连上(很多没有连的原因?)?

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

(189) #1
克隆策略
In [20]:
m2.data.read()
Out[20]:
date instrument

    {"Description":"实验创建于2019/10/30","Summary":"","Graph":{"EdgesInternal":[{"DestinationInputPortId":"-278:instruments","SourceOutputPortId":"-269:data"},{"DestinationInputPortId":"-278:features","SourceOutputPortId":"-284:data"}],"ModuleNodes":[{"Id":"-269","ModuleId":"BigQuantSpace.instruments.instruments-v2","ModuleParameters":[{"Name":"start_date","Value":"2019-01-01","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"2019-10-30","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"market","Value":"CN_FUND","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"instrument_list","Value":"510050.OFA\n510300.OFA","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"max_count","Value":0,"ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"rolling_conf","NodeId":"-269"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-269","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":1,"IsPartOfPartialRun":null,"Comment":"","CommentCollapsed":true},{"Id":"-278","ModuleId":"BigQuantSpace.use_datasource.use_datasource-v1","ModuleParameters":[{"Name":"datasource_id","Value":"bar1d_CN_FUND","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"start_date","Value":"2019-01-01","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"2019-10-30","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"instruments","NodeId":"-278"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features","NodeId":"-278"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-278","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":2,"IsPartOfPartialRun":null,"Comment":"","CommentCollapsed":true},{"Id":"-284","ModuleId":"BigQuantSpace.input_features.input_features-v1","ModuleParameters":[{"Name":"features","Value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nclose_0\n","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features_ds","NodeId":"-284"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-284","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":3,"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='-269' Position='80,154,200,200'/><NodePosition Node='-278' Position='186,300,200,200'/><NodePosition Node='-284' Position='454,112,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 [19]:
    # 本代码由可视化策略环境自动生成 2019年10月30日 16:19
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    m1 = M.instruments.v2(
        start_date='2019-01-01',
        end_date='2019-10-30',
        market='CN_FUND',
        instrument_list="""510050.OFA
    510300.OFA""",
        max_count=0
    )
    
    m3 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    close_0
    """
    )
    
    m2 = M.use_datasource.v1(
        instruments=m1.data,
        features=m3.data,
        datasource_id='bar1d_CN_FUND',
        start_date='2019-01-01',
        end_date='2019-10-30'
    )
    

    (达达) #2

    字段名,请参考文档对应表数据的字段名称。


    (189) #3

    我用数据源的这个ID来取日线数据:bar1d_CN_FUND,难道不是这个ID?
    close_0填入输入特征;
    另外我发现有些是不用连数据源的,连了数据源的也不连基础特征抽取但是要连衍生特征,这里的原因能否简单说说?


    (189) #4

    我把close_0改为close也出不来


    (189) #5

    我查到原因了,是510300.HOF才是行情代码,但是你们的股票代码列表,输入510300.时,会自动弹出510300.OFA的提示,这就是一个坑!能不能把这个改一下?自动弹出510300.HOF
    另外查代码要从这里查:https://bigquant.com/docs/datasource/data_basic_info_CN_FUND.html


    (iQuant) #6

    收到,这个我去反馈一下哈。