import pandas as pd
第一步:选出最近连续两天量价换手率齐升的股票;
dates1=[20161103,20161104]
pieces1=[]
for date in dates1:
path='All_stock/%d/stock overview.csv'%date
data1=pd.read_csv(path,encoding='gbk')
pieces1.append(data1)
data1=pd.concat(pieces1,ignore_index=True)
index_data_A=data1[['股票代码','交易日期','开盘价','收盘价','换手率']]
index_data_A.交易日期=pd.to_datetime(index_data_A.交易日期)
index_data_A=index_data_A.set_index('交易日期')
index_data1=index_data_A.groupby(['股票代码']).last()
index_data2=index_data_A.groupby(['股票代码']).first()
index_data1=index_data1.reset_index()
index_data2=index_data2.reset_index()
index_data_A=pd.merge(index_data1,index_data2,on='股票代码')
index_data_A['开盘价差']=index_data_A.开盘价_x-index_data_A.开盘价_y
index_data_A['收盘价差']=index_data_A.收盘价_x-index_data_A.收盘价_y
index_data_A['换手率差']=index_data_A.换手率_x-index_data_A.换手率_y
index_data_A=index_data_A[(index_data_A.开盘价差>0)&(index_dat