我想获得某一天前面10天的数据该如何表达,不想获取之前所有数据。

新手专区
标签: #<Tag:0x00007fa199b263c0>

(tkbq66) #1
克隆策略

    {"Description":"实验创建于2020/8/19","Summary":"","Graph":{"EdgesInternal":[],"ModuleNodes":[],"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>"},"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}
    In [ ]:
    # 本代码由可视化策略环境自动生成 2020年8月19日 12:20
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    In [8]:
    DataSource('bar1d_CN_STOCK_A').read(instruments='000001.SZA',end_date='2020-07-14',fields=['close'])
    
    Out[8]:
    date instrument close
    0 2005-01-04 000001.SZA 163.100143
    1 2005-01-05 000001.SZA 161.599213
    2 2005-01-06 000001.SZA 163.100143
    3 2005-01-07 000001.SZA 162.849991
    4 2005-01-10 000001.SZA 164.851212
    5 2005-01-11 000001.SZA 164.851212
    6 2005-01-12 000001.SZA 163.350296
    7 2005-01-13 000001.SZA 164.350906
    8 2005-01-14 000001.SZA 162.599838
    9 2005-01-17 000001.SZA 156.345993
    10 2005-01-18 000001.SZA 155.595535
    11 2005-01-19 000001.SZA 154.094604
    12 2005-01-20 000001.SZA 150.342300
    13 2005-01-21 000001.SZA 160.348450
    14 2005-01-24 000001.SZA 161.849365
    15 2005-01-25 000001.SZA 157.846909
    16 2005-01-26 000001.SZA 157.596756
    17 2005-01-27 000001.SZA 153.594299
    18 2005-01-28 000001.SZA 154.344772
    19 2005-01-31 000001.SZA 151.593079
    20 2005-02-01 000001.SZA 152.343536
    21 2005-02-02 000001.SZA 160.098297
    22 2005-02-03 000001.SZA 157.846909
    23 2005-02-04 000001.SZA 165.101364
    24 2005-02-16 000001.SZA 164.851212
    25 2005-02-17 000001.SZA 164.100754
    26 2005-02-18 000001.SZA 165.101364
    27 2005-02-21 000001.SZA 167.853058
    28 2005-02-22 000001.SZA 168.603516
    29 2005-02-23 000001.SZA 166.852448
    ... ... ... ...
    3743 2020-06-01 000001.SZA 1479.168823
    3744 2020-06-02 000001.SZA 1504.710083
    3745 2020-06-03 000001.SZA 1503.599609
    3746 2020-06-04 000001.SZA 1506.931030
    3747 2020-06-05 000001.SZA 1509.151978
    3748 2020-06-08 000001.SZA 1512.483521
    3749 2020-06-09 000001.SZA 1518.035889
    3750 2020-06-10 000001.SZA 1498.047119
    3751 2020-06-11 000001.SZA 1452.517212
    3752 2020-06-12 000001.SZA 1442.522827
    3753 2020-06-15 000001.SZA 1423.644531
    3754 2020-06-16 000001.SZA 1431.417969
    3755 2020-06-17 000001.SZA 1426.975952
    3756 2020-06-18 000001.SZA 1416.981567
    3757 2020-06-19 000001.SZA 1421.423584
    3758 2020-06-22 000001.SZA 1403.655762
    3759 2020-06-23 000001.SZA 1399.213745
    3760 2020-06-24 000001.SZA 1421.423584
    3761 2020-06-29 000001.SZA 1421.423584
    3762 2020-06-30 000001.SZA 1421.423584
    3763 2020-07-01 000001.SZA 1456.959106
    3764 2020-07-02 000001.SZA 1491.384155
    3765 2020-07-03 000001.SZA 1582.444214
    3766 2020-07-06 000001.SZA 1741.243774
    3767 2020-07-07 000001.SZA 1719.034058
    3768 2020-07-08 000001.SZA 1750.127686
    3769 2020-07-09 000001.SZA 1724.586548
    3770 2020-07-10 000001.SZA 1650.183838
    3771 2020-07-13 000001.SZA 1653.515381
    3772 2020-07-14 000001.SZA 1630.195068

    3773 rows × 3 columns


    (adhaha111) #2

    image