waditu / tushare

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

get_k_data() 获取 603986 的日线数据没有复权 #1363

Closed 7forz closed 4 years ago

7forz commented 4 years ago

ts.version '1.2.59'

ts.get_k_data('603986', start='2020-04-01', autype='qfq') date open close high low volume code 58 2020-04-01 237.00 242.29 252.10 236.00 95974.0 603986 59 2020-04-02 242.55 266.52 266.52 242.42 156493.0 603986 60 2020-04-03 262.67 257.78 266.00 256.00 109759.0 603986 ... 77 2020-04-29 262.96 252.56 262.97 251.00 71373.0 603986 78 2020-04-30 260.00 277.82 277.82 257.50 123861.0 603986 79 2020-05-06 284.99 305.60 305.60 280.11 122624.0 603986 80 2020-05-07 226.73 226.00 231.77 220.00 179316.0 603986 # 这一天应该有复权 81 2020-05-08 225.01 221.01 228.58 218.01 186036.0 603986 82 2020-05-11 223.00 220.38 226.67 218.39 131250.0 603986 83 2020-05-12 221.00 217.89 221.00 209.35 154692.0 603986 84 2020-05-13 214.21 219.00 220.50 213.30 109536.0 603986 85 2020-05-14 217.50 214.73 220.00 214.53 109815.0 603986 86 2020-05-15 216.20 230.00 236.20 214.80 245054.0 603986

对比 ts pro,是有复权的:

ts.pro_bar(ts_code='603986.SH', adj='qfq', start_date='20200401', end_date='20200516') ts_code trade_date open high ... change pct_chg vol amount 0 603986.SH 20200515 216.2000 236.2000 ... 15.2700 7.1113 245053.76 5596530.516 1 603986.SH 20200514 217.5000 220.0000 ... -4.2700 -1.9498 109815.36 2378616.816 2 603986.SH 20200513 214.2100 220.5000 ... 1.1100 0.5094 109535.82 2376469.639 3 603986.SH 20200512 221.0000 221.0000 ... -2.4900 -1.1299 154692.17 3327076.011 4 603986.SH 20200511 223.0000 226.6700 ... -0.6300 -0.2851 131249.87 2912914.351 5 603986.SH 20200508 225.0100 228.5800 ... -4.9900 -2.2080 186035.78 4134251.372 6 603986.SH 20200507 226.7300 231.7700 ... 7.9900 3.6650 179315.87 4047632.496 7 603986.SH 20200506 203.2866 217.9880 ... 19.8158 9.9993 122623.66 3618222.419 8 603986.SH 20200430 185.4610 198.1722 ... 18.0183 10.0016 123860.65 3367841.695 9 603986.SH 20200429 187.5724 187.5795 ... -4.8078 -2.5993 71372.64 1828996.008 10 603986.SH 20200428 176.4804 185.3040 ... 9.4871 5.4065 99718.70 2530240.367 11 603986.SH 20200427 175.5031 176.8299 ... -0.0642 -0.0366 50751.04 1232359.390

是数据源的问题?

jimmysoa commented 4 years ago

请使用tushare pro版,https://tushare.pro/document/2?doc_id=146