更多精彩内容详见个人量化交易专辑索引
数据示例:
code | date | opening_price | closeing_price | max_price | min_price | change_rate | change_price | volume | turnover | amplitude | turnover_rate |
1 | 2022/1/4 | 2847.3 | 2876.56 | 2876.56 | 2798.54 | 1.03 | 29.26 | 1169260 | 1918890000 | 2.74 | 0.6 |
1 | 2022/1/5 | 2863.55 | 2956.19 | 2967.57 | 2858.68 | 2.77 | 79.63 | 1962000 | 3344120000 | 3.79 | 1.01 |
1 | 2022/1/6 | 2949.69 | 2951.32 | 2975.7 | 2931.82 | -0.16 | -4.87 | 1107880 | 1896540000 | 1.48 | 0.57 |
1 | 2022/1/7 | 2948.07 | 2964.32 | 2977.32 | 2941.57 | 0.44 | 13 | 1126630 | 1937710000 | 1.21 | 0.58 |
1 | 2022/1/10 | 2978.95 | 2962.7 | 3000.08 | 2936.69 | -0.05 | -1.62 | 909774 | 1563410000 | 2.14 | 0.47 |
1 | 2022/1/11 | 2974.07 | 2998.45 | 3019.58 | 2954.57 | 1.21 | 35.75 | 1582000 | 2752490000 | 2.19 | 0.82 |
1 | 2022/1/12 | 2998.45 | 2931.82 | 3004.95 | 2915.56 | -2.22 | -66.63 | 1502160 | 2561270000 | 2.98 | 0.77 |
1 | 2022/1/13 | 2917.19 | 2928.57 | 2970.82 | 2902.56 | -0.11 | -3.25 | 909423 | 1550320000 | 2.33 | 0.47 |
1 | 2022/1/14 | 2931.82 | 2822.92 | 2935.07 | 2818.05 | -3.61 | -105.65 | 2103100 | 3459950000 | 4 | 1.08 |
1 | 2022/1/17 | 2826.17 | 2805.04 | 2847.3 | 2788.79 | -0.63 | -17.88 | 1143690 | 1855630000 | 2.07 | 0.59 |
代码示例:
import akshare as ak
# 采集“002555”从2022-01-01到2022-12-31每天后复权日线数据
df = ak.stock_zh_a_hist(symbol="002555", period="daily", start_date="20220101", end_date='20221231', adjust="hfq")
df.to_csv('data.csv', header=True, index=False)
更多历史数据下载: