怎么数据是错的?


(felixice) #1

D.history_data(instruments=[‘000717.SZA’,‘000651.SZA’], start_date=‘2018-06-21’, end_date=‘2018-06-28’,
fields=[‘open’, ‘high’, ‘low’, ‘close’])

high date open close low instrument
0 7302.283203 2018-06-21 7160.244629 7155.758789 7125.855957 000651.SZA
1 32.801872 2018-06-21 31.139311 31.408915 31.094376 000717.SZA
2 7193.137695 2018-06-22 7101.933594 7185.662109 7006.244629 000651.SZA
3 33.026543 2018-06-22 30.555168 32.352531 30.330498 000717.SZA
4 7324.710449 2018-06-25 7214.069824 7140.807617 7109.409668 000651.SZA
5 32.622135 2018-06-25 32.622135 31.633585 31.588652 000717.SZA
6 7140.807617 2018-06-26 7042.127930 7072.030762 6970.361328 000651.SZA
7 31.004509 2018-06-26 30.555168 30.330498 29.341948 000717.SZA
8 7131.836914 2018-06-27 7081.001953 6798.419434 6755.060547 000651.SZA
9 30.600101 2018-06-27 30.375431 29.207146 28.802738 000717.SZA
10 6865.701172 2018-06-28 6713.196289 6755.060547 6684.788574 000651.SZA
11 29.791288 2018-06-28 29.701420 28.757805 28.533134 000717.SZA


(iQuant) #2

默认是后复权数据
df=D.history_data(instruments=[‘000001.SZA’], start_date=‘2017-01-01’, end_date=‘2017-01-07’,
fields=[‘open’, ‘high’, ‘low’, ‘close’,‘adjust_factor’])
然后
df[‘open’]=df[‘open’]/df[‘adjust_factor’]得到对应的真实价格