指数月线行情


接口:index_monthly
描述:获取指数月线行情,每月更新一次
限量:单次最大1000行记录,可多次获取,总量不限制



输入参数

名称 类型 必选 描述
ts_code str N TS代码
trade_date str N 交易日期
start_date str N 开始日期
end_date str N 结束日期


输出参数

名称 类型 默认显示 描述
ts_code str Y TS指数代码
trade_date str Y 交易日
close float Y 收盘点位
open float Y 开盘点位
high float Y 最高点位
low float Y 最低点位
pre_close float Y 昨日收盘点
change float Y 涨跌点位
pct_chg float Y 涨跌幅
vol float Y 成交量
amount float Y 成交额


接口用法


pro = ts.pro_api()

df = pro.index_monthly(ts_code='000001.SH', start_date='20180101', end_date='20190330', fields='ts_code,trade_date,open,high,low,close,vol,amount')

或者


df = pro.index_monthly(trade_date='20190329', fields='ts_code,trade_date,open,high,low,close,vol,amount')


数据样例

      ts_code  trade_date     close      open      high       low  \
0   000001.SH   20190329  3090.758  2954.402  3129.940  2930.835   
1   000001.SH   20190228  2940.954  2597.778  2997.488  2590.554   
2   000001.SH   20190131  2584.572  2497.881  2630.318  2440.907   
3   000001.SH   20181228  2493.896  2647.132  2666.078  2462.845   
4   000001.SH   20181130  2588.188  2617.033  2703.512  2555.322   
5   000001.SH   20181031  2602.783  2768.208  2771.938  2449.197   
6   000001.SH   20180928  2821.350  2716.404  2827.341  2644.296   
7   000001.SH   20180831  2725.250  2882.506  2897.400  2653.112   
8   000001.SH   20180731  2876.401  2841.580  2915.297  2691.021   
9   000001.SH   20180629  2847.418  3084.754  3128.715  2782.381   
10  000001.SH   20180531  3095.474  3087.409  3219.740  3041.000   
11  000001.SH   20180427  3082.232  3169.779  3220.845  3041.625   
12  000001.SH   20180330  3168.897  3235.089  3333.875  3091.458   
13  000001.SH   20180228  3259.408  3478.670  3495.093  3062.743   
14  000001.SH   20180131  3480.833  3314.031  3587.032  3314.031   

             vol        amount  
0   8.691925e+11  8.300906e+12  
1   4.421808e+11  3.816145e+12  
2   3.385641e+11  2.804232e+12  
3   2.575119e+11  2.236021e+12  
4   4.052823e+11  3.352502e+12  
5   2.740242e+11  2.449081e+12  
6   2.148359e+11  2.152910e+12  
7   2.821389e+11  2.872973e+12  
8   3.049095e+11  3.259243e+12  
9   2.623979e+11  3.100450e+12  
10  2.979289e+11  3.810441e+12  
11  2.698985e+11  3.372116e+12  
12  3.704084e+11  4.396937e+12  
13  2.888959e+11  3.262255e+12  
14  4.797771e+11  5.772056e+12  
-->
置顶