def Market_statistics(check_date,filter_st=True):
'''check_date: 统计日期,
filter_st: 是否过滤st'''
info_data = get_all_securities(date=check_date)
all_list = info_data.index.tolist()
st_df = get_extras('is_st', all_list,end_date=check_date, df=True, count=1).T
st_list = st_df[st_df.iloc[:,0]].index.tolist()
print ('st股票有%s只'%len(st_list))
print ('未退市的有%s只'%len(all_list))
all_data = get_price(all_list,end_date=check_date,count=2,fields=['paused','close','high_limit','low_limit'])
paused_data = all_data.paused.iloc[-1]
paused_list = paused_data[paused_data==1].index.tolist()
print ('停牌%s只'%len(paused_list))
new_data = all_data.drop(paused_list,axis=2)
if filter_st ==True:
filter_list = list(set(st_list)-set(paused_list))
new_data = new_data.drop(filter_list,axis=2)
pct_data = new_data.close.pct_change().iloc[1]
print ('当日新上市股票:%s'%pct_data[np.isnan(pct_data)].index.tolist())
print ('上涨%s只(不含当日上市)'%len(pct_data[pct_data>=0]))
print ('下跌%s只'%len(pct_data[pct_data<0]))
limit_up_data = new_data.iloc[:,-1,:][new_data.iloc[:,-1,:].close==new_data.iloc[:,-1,:].high_limit]
print ('涨停%s只'%len(limit_up_data))
limit_down_data = new_data.iloc[:,-1,:][new_data.iloc[:,-1,:].close==new_data.iloc[:,-1,:].low_limit]
print ('跌停%s只'%len(limit_down_data))
Market_statistics('2019-09-03')