很多人都在询问如何获取股票涨停时间
在此分享一下,欢迎交流、讨论
def high_limit_time(stock,date):'''
Ep:
stock = '000921.XSHE'
date = '2018-08-30'
t = high_limit_time(stock,date)
print(t)
'''df = get_price(stock,end_date=date ' 15:00:00',frequency='1m',count=240,fields=['close','high_limit'])return(df[df.close==df.high_limit].index[0])
打印最高/最低价时间
def max_min_time(stocks,date):std = date ' 09:00:00'etd = date ' 15:30:00'for st in stocks:
print(st)
print("max_time")
print(get_price(st, start_date=std, end_date=etd, frequency='1m')['close'].idxmax())
print("min_time")
print(get_price(st, start_date=std, end_date=etd, frequency='1m')['close'].idxmin())
print('-'*30)
stock = ['000001.XSHE','000002.XSHE']
date = '2019-04-01'max_min_time(stock,date)