from jqdata import *
import re
df = get_all_securities(date='2019-09-18')
startdate='2019-09-19'
enddate='2019-09-23'
stock_list=df.index
for i in range(len(stock_list)):
df2=get_money_flow(stock_list[i], start_date=startdate, end_date=enddate, fields='change_pct')
if len(df2)==3 and df2.iloc[0,0]> 9.9:
industry=get_industry(stock_list[i],date=None)
q = query(
valuation
).filter(
valuation.code == stock_list[i]
)
fundamentals=get_fundamentals(q, startdate)
print(stock_list[i],df2.iloc[0,0],"今天涨停",'上交易日涨幅:',df2.iloc[1,0],'\n',
'市值(亿):',fundamentals['market_cap'][0],'市盈:',fundamentals['pe_ratio'][0],
'市净:',fundamentals['pb_ratio'][0],'\n'
)
print('\n','今日涨停板输出完成','\n')
for i in range(len(stock_list)):
df2=get_money_flow(stock_list[i], start_date=startdate, end_date=enddate, fields='change_pct')
if len(df2)==3 and (df2.iloc[0,0]*df2.iloc[1,0])> 9.9**2 and df2.iloc[0,0]>0:
industry=get_industry(stock_list[i],date=None)
q = query(
valuation
).filter(
valuation.code == stock_list[i]
)
fundamentals=get_fundamentals(q, startdate)
print(stock_list[i],df2.iloc[0,0],df2.iloc[1,0],'双连板','\n',
'市值(亿):',fundamentals['market_cap'][0],'市盈:',fundamentals['pe_ratio'][0],
'市净:',fundamentals['pb_ratio'][0],'\n')
print('\n','双连板输出完成','\n')
for i in range(len(stock_list)):
df2=get_money_flow(stock_list[i], start_date=startdate, end_date=enddate, fields='change_pct')
if len(df2)==3 and (df2.iloc[0,0]*df2.iloc[1,0]*df2.iloc[2,0])> 9.9**3 and df2.iloc[0,0]>0:
ndustry=get_industry(stock_list[i],date=None)
q = query(
valuation
).filter(
valuation.code == stock_list[i]
)
fundamentals=get_fundamentals(q, startdate)
print(stock_list[i],df2.iloc[0,0],df2.iloc[1,0],df2.iloc[2,0],'三连板','\n',
'市值(亿):',fundamentals['market_cap'][0],'市盈:',fundamentals['pe_ratio'][0],
'市净:',fundamentals['pb_ratio'][0],'\n')
print('\n','三连板输出完成','\n')