复制链接
克隆策略
In [4]:
m7.data.read()
Out[4]:
date instrument amount close high low open open_intl settle volume low_limit high_limit product_code
0 2021-10-08 A0000.DCE 1.539538e+10 6147.128418 6269.467773 5956.736328 5956.736328 207301.0 6161.276855 249540.0 5469.380273 6420.239931 A
1 2021-10-08 A2111.DCE 9.136978e+09 6180.000000 6280.000000 5951.000000 5951.000000 92200.0 6186.000000 147701.0 5463.000000 6413.000000 A
2 2021-10-08 A2201.DCE 4.579488e+09 6140.000000 6209.000000 5969.000000 5969.000000 67686.0 6155.000000 74395.0 5478.000000 6430.000000 A
3 2021-10-08 A2203.DCE 1.171506e+09 6109.000000 6406.000000 5953.000000 5953.000000 35977.0 6139.000000 19081.0 5474.000000 6426.000000 A
4 2021-10-08 A2205.DCE 1.555876e+08 6080.000000 6148.000000 5965.000000 5965.000000 4185.0 6096.000000 2552.0 5468.000000 6418.000000 A
... ... ... ... ... ... ... ... ... ... ... ... ... ...
87383 2022-03-01 ZN2212.SHF 1.252000e+05 25040.000000 25040.000000 25040.000000 25040.000000 36.0 25040.000000 1.0 22700.000000 26645.000000 ZN
87384 2022-03-01 ZN2301.SHF 6.272500e+05 25050.000000 25100.000000 25050.000000 25100.000000 40.0 25090.000000 5.0 22710.000000 26655.000000 ZN
87385 2022-03-01 ZN2302.SHF 6.248750e+05 25085.000000 25085.000000 24965.000000 24995.000000 6.0 24995.000000 5.0 22790.000000 26755.000000 ZN
87386 2022-03-01 ZN8888.SHF 1.910724e+10 25185.000000 25340.000000 24955.000000 24955.000000 121830.0 25190.000000 151684.0 22910.000000 26895.000000 ZN
87387 2022-03-01 ZN9999.SHF 1.910724e+10 23695.000000 23845.000000 23480.000000 23480.000000 121830.0 23700.000000 151684.0 21555.000000 25305.000000 ZN

87388 rows × 13 columns

In [9]:
m2.data.read()
Out[9]:
date instrument amount close high low open open_intl settle volume low_limit high_limit product_code ma5 amount/volume
0 2021-10-08 A0000.DCE 1.539538e+10 6147.128418 6269.467773 5956.736328 5956.736328 207301.0 6161.276855 249540.0 5469.380273 6420.239931 A NaN 61695.048048
1 2021-10-08 A2111.DCE 9.136978e+09 6180.000000 6280.000000 5951.000000 5951.000000 92200.0 6186.000000 147701.0 5463.000000 6413.000000 A NaN 61861.312449
2 2021-10-08 A2201.DCE 4.579488e+09 6140.000000 6209.000000 5969.000000 5969.000000 67686.0 6155.000000 74395.0 5478.000000 6430.000000 A NaN 61556.398952
3 2021-10-08 A2203.DCE 1.171506e+09 6109.000000 6406.000000 5953.000000 5953.000000 35977.0 6139.000000 19081.0 5474.000000 6426.000000 A NaN 61396.460877
4 2021-10-08 A2205.DCE 1.555876e+08 6080.000000 6148.000000 5965.000000 5965.000000 4185.0 6096.000000 2552.0 5468.000000 6418.000000 A NaN 60966.916144
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
87383 2022-03-01 ZN2212.SHF 1.252000e+05 25040.000000 25040.000000 25040.000000 25040.000000 36.0 25040.000000 1.0 22700.000000 26645.000000 ZN 24760.0 125200.000000
87384 2022-03-01 ZN2301.SHF 6.272500e+05 25050.000000 25100.000000 25050.000000 25100.000000 40.0 25090.000000 5.0 22710.000000 26655.000000 ZN 24806.0 125450.000000
87385 2022-03-01 ZN2302.SHF 6.248750e+05 25085.000000 25085.000000 24965.000000 24995.000000 6.0 24995.000000 5.0 22790.000000 26755.000000 ZN 24785.0 124975.000000
87386 2022-03-01 ZN8888.SHF 1.910724e+10 25185.000000 25340.000000 24955.000000 24955.000000 121830.0 25190.000000 151684.0 22910.000000 26895.000000 ZN 24956.0 125967.431140
87387 2022-03-01 ZN9999.SHF 1.910724e+10 23695.000000 23845.000000 23480.000000 23480.000000 121830.0 23700.000000 151684.0 21555.000000 25305.000000 ZN 23481.0 125967.431140

87388 rows × 15 columns

    {"description":"实验创建于2021/9/4","graph":{"edges":[{"to_node_id":"-42:features","from_node_id":"-2574:data"},{"to_node_id":"-42:input_data","from_node_id":"-51:data"}],"nodes":[{"node_id":"-2574","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nma5=mean(close,5)\namount/volume","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-2574"}],"output_ports":[{"name":"data","node_id":"-2574"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true},{"node_id":"-42","module_id":"BigQuantSpace.derived_feature_extractor.derived_feature_extractor-v3","parameters":[{"name":"date_col","value":"date","type":"Literal","bound_global_parameter":null},{"name":"instrument_col","value":"instrument","type":"Literal","bound_global_parameter":null},{"name":"drop_na","value":"False","type":"Literal","bound_global_parameter":null},{"name":"remove_extra_columns","value":"False","type":"Literal","bound_global_parameter":null},{"name":"user_functions","value":"{}","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"-42"},{"name":"features","node_id":"-42"}],"output_ports":[{"name":"data","node_id":"-42"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true},{"node_id":"-51","module_id":"BigQuantSpace.use_datasource.use_datasource-v2","parameters":[{"name":"datasource_id","value":"bar1d_CN_FUTURE","type":"Literal","bound_global_parameter":null},{"name":"start_date","value":"2022-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2022-03-01","type":"Literal","bound_global_parameter":null},{"name":"before_start_days","value":"90","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-51"},{"name":"features","node_id":"-51"}],"output_ports":[{"name":"data","node_id":"-51"}],"cacheable":true,"seq_num":7,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-2574' Position='603.8026733398438,28.67849349975586,200,200'/><node_position Node='-42' Position='387.34423828125,118.2349853515625,200,200'/><node_position Node='-51' Position='305.92510986328125,21.738357543945312,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
    In [8]:
    # 本代码由可视化策略环境自动生成 2022年11月16日 15:50
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    m3 = M.input_features.v1(
        features="""
    # #号开始的表示注释,注释需单独一行
    # 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征
    ma5=mean(close,5)
    amount/volume"""
    )
    
    m7 = M.use_datasource.v2(
        datasource_id='bar1d_CN_FUTURE',
        start_date='2022-01-01',
        end_date='2022-03-01',
        before_start_days=90
    )
    
    m2 = M.derived_feature_extractor.v3(
        input_data=m7.data,
        features=m3.data,
        date_col='date',
        instrument_col='instrument',
        drop_na=False,
        remove_extra_columns=False,
        user_functions={}
    )
    
    In [ ]: