复制链接
克隆策略
In [3]:
df = DataSource('bar1d_CN_STOCK_A').read(instruments=['600031.SHA'], start_date='2021-12-01', end_date='2021-12-31', adjust_type='pre')
df.tail()
Out[3]:
turn adjust_factor instrument date open volume low deal_number close high amount
18 0.766817 49.292782 600031.SHA 2021-12-27 23.360001 65119869.0 23.190001 78715.0 23.510000 23.739998 1.531566e+09
19 1.044564 49.292782 600031.SHA 2021-12-28 23.579998 88706747.0 23.579998 107418.0 23.749998 24.000000 2.111211e+09
20 0.798631 49.292782 600031.SHA 2021-12-29 23.769999 67821577.0 23.330000 92780.0 23.350000 23.859999 1.593028e+09
21 0.875975 49.292782 600031.SHA 2021-12-30 23.219999 74389831.0 23.099998 92909.0 23.139997 23.299997 1.724204e+09
22 1.150565 49.292782 600031.SHA 2021-12-31 23.180000 97708670.0 22.719999 0.0 22.799999 23.269999 2.243586e+09
In [8]:
general_feature_train = M.general_feature_extractor.v7(
    instruments=['600031.SHA'],
    features=['close_0','open_0'],
    start_date='2021-12-01',
    end_date='2021-12-31',
    before_start_days=20
)
general_feature_train.data.read().sort_values('date', ascending=False)[['date','instrument','close_0','open_0']].head()
Out[8]:
date instrument close_0 open_0
36 2021-12-31 600031.SHA 1123.875366 1142.606689
35 2021-12-30 600031.SHA 1140.634888 1144.578369
34 2021-12-29 600031.SHA 1150.986450 1171.689331
33 2021-12-28 600031.SHA 1170.703491 1162.323730
32 2021-12-27 600031.SHA 1158.873291 1151.479370
In [ ]: