支持读取三个月内的历史分钟K线数据,1分钟、5分钟、15分钟、30分钟、60分钟等。
读取1分钟历史数据
# 读取1分钟K线数据
result = dd.get_klines("000001",dsxquant.MARKET.SZ,cycle=dsxquant.config.CYCLE.M1,page_size=1000).dataframe()
print(result)
返回数据格式
0
0 202302240931,14.02,14.03,13.94,13.96,26062,364...
1 202302240932,13.96,13.96,13.92,13.96,10384,144...
2 202302240933,13.96,13.96,13.93,13.94,6386,8908...
3 202302240934,13.93,13.94,13.92,13.93,10046,139...
4 202302240935,13.93,13.93,13.92,13.93,4432,6172...
.. ...
475 202302031456,14.35,14.36,14.34,14.35,3920,5624...
476 202302031457,14.36,14.36,14.34,14.34,5109,7332...
477 202302031458,14.35,14.35,14.35,14.35,585,84005...
478 202302031459,14.35,14.35,14.35,14.35,0,0.00
479 202302031500,14.32,14.32,14.32,14.32,21701,310...
读取5分钟历史数据
# 读取5分钟K线数据
result = dd.get_klines("000001",dsxquant.MARKET.SZ,cycle=dsxquant.config.CYCLE.M5,page_size=1000).dataframe()
print(result)
读取15分钟历史数据
# 读取15分钟K线数据
result = dd.get_klines("000001",dsxquant.MARKET.SZ,cycle=dsxquant.config.CYCLE.M15,page_size=1000).dataframe()
print(result)
读取30分钟历史数据
# 读取30分钟K线数据
result = dd.get_klines("000001",dsxquant.MARKET.SZ,cycle=dsxquant.config.CYCLE.M30,page_size=1000).dataframe()
print(result)
读取60分钟历史数据
# 读取60分钟K线数据
result = dd.get_klines("000001",dsxquant.MARKET.SZ,cycle=dsxquant.config.CYCLE.M60,page_size=1000).dataframe()
print(result)