waditu / tushare

TuShare is a utility for crawling historical data of China stocks
BSD 3-Clause "New" or "Revised" License
12.91k stars 4.29k forks source link

pro_bar接口的股票复权数据不正确 #1736

Closed justin745 closed 5 months ago

justin745 commented 6 months ago

从pro_bar接口获取复权数据时,返回的‘pre_close’数据没有复权,造成‘change’, ‘pct_chg’等数据也不正确。

比如,

df = ts.pro_bar(ts_code='300856.SZ', adj='hfq', start_date='20240523', end_date='20240523')
print(df.to_string())

     ts_code trade_date      open      high       low    close  pre_close  change   pct_chg       vol      amount
0  300856.SZ   20240523  121.2607  121.2607  115.2227  117.788       38.7  79.088  204.3618  76883.44  287933.268