#以今天的上线浮动12%,看是否盘整
df1['c_up_12per'] = df1['close'].shift(14)*1.12
df1['c_down_12per'] = df1['close'].shift(14)*0.88
df1['c_shitf1_nei_flag'] = np.where((df1['close'].shift(1)> df1['c_down_12per']) & (df1['close'].shift(1)< df1['c_up_12per']),1,0)
df1['c_shitf1_down_flag'] = np.where(df1['close'].shift(1)< df1['c_down_12per'],1,0)
df1['c_shitf1_up_flag'] = np.where(df1['close'].shift(1)> df1['c_up_12per'],1,0)
df1['c_shitf2_nei_flag'] = np.where((df1['close'].shift(2)> df1['c_down_12per']) & (df1['close'].shift(2)< df1['c_up_12per']),1,0)
df1['c_shitf2_down_flag'] = np.where(df1['close'].shift(2)< df1['c_down_12per'],1,0)
df1['c_shitf2_up_flag'] = np.where(df1['close'].shift(2)> df1['c_up_12per'],1,0)
df1['c_shitf3_nei_flag'] = np.where((df1['close'].shift(3)> df1['c_down_12per']) & (df1['close'].shift(3)< df1['c_up_12per']),1,0)
df1['c_shitf3_down_flag'] = np.where(df1['close'].shift(3)< df1['c_down_12per'],1,0)
df1['c_shitf3_up_flag'] = np.where(df1['close'].shift(3)> df1['c_up_12per'],1,0)
df1['c_shitf4_nei_flag'] = np.where((df1['close'].shift(4)> df1['c_down_12per']) & (df1['close'].shift(4)< df1['c_up_12per']),1,0)
df1['c_shitf4_down_flag'] = np.where(df1['close'].shift(4)< df1['c_down_12per'],1,0)
df1['c_shitf4_up_flag'] = np.where(df1['close'].shift(4)> df1['c_up_12per'],1,0)
df1['c_shitf5_nei_flag'] = np.where((df1['close'].shift(5)> df1['c_down_12per']) & (df1['close'].shift(5)< df1['c_up_12per']),1,0)
df1['c_shitf5_down_flag'] = np.where(df1['close'].shift(5)< df1['c_down_12per'],1,0)
df1['c_shitf5_up_flag'] = np.where(df1['close'].shift(5)> df1['c_up_12per'],1,0)
df1['c_shitf6_nei_flag'] = np.where((df1['close'].shift(6)> df1['c_down_12per']) & (df1['close'].shift(6)< df1['c_up_12per']),1,0)
df1['c_shitf6_down_flag'] = np.where(df1['close'].shift(6)< df1['c_down_12per'],1,0)
df1['c_shitf6_up_flag'] = np.where(df1['close'].shift(6)> df1['c_up_12per'],1,0)
df1['c_shitf7_nei_flag'] = np.where((df1['close'].shift(7)> df1['c_down_12per']) & (df1['close'].shift(7)< df1['c_up_12per']),1,0)
df1['c_shitf7_down_flag'] = np.where(df1['close'].shift(7)< df1['c_down_12per'],1,0)
df1['c_shitf7_up_flag'] = np.where(df1['close'].shift(7)> df1['c_up_12per'],1,0)
df1['c_shitf8_nei_flag'] = np.where((df1['close'].shift(8)> df1['c_down_12per']) & (df1['close'].shift(8)< df1['c_up_12per']),1,0)
df1['c_shitf8_down_flag'] = np.where(df1['close'].shift(8)< df1['c_down_12per'],1,0)
df1['c_shitf8_up_flag'] = np.where(df1['close'].shift(8)> df1['c_up_12per'],1,0)
df1['c_shitf9_nei_flag'] = np.where((df1['close'].shift(9)> df1['c_down_12per']) & (df1['close'].shift(9)< df1['c_up_12per']),1,0)
df1['c_shitf9_down_flag'] = np.where(df1['close'].shift(9)< df1['c_down_12per'],1,0)
df1['c_shitf9_up_flag'] = np.where(df1['close'].shift(9)> df1['c_up_12per'],1,0)
df1['c_shitf10_nei_flag'] = np.where((df1['close'].shift(10)> df1['c_down_12per']) & (df1['close'].shift(10)< df1['c_up_12per']),1,0)
df1['c_shitf10_down_flag'] = np.where(df1['close'].shift(10)< df1['c_down_12per'],1,0)
df1['c_shitf10_up_flag'] = np.where(df1['close'].shift(10)> df1['c_up_12per'],1,0)
df1['c_shitf11_nei_flag'] = np.where((df1['close'].shift(11)> df1['c_down_12per']) & (df1['close'].shift(11)< df1['c_up_12per']),1,0)
df1['c_shitf11_down_flag'] = np.where(df1['close'].shift(11)< df1['c_down_12per'],1,0)
df1['c_shitf11_up_flag'] = np.where(df1['close'].shift(11)> df1['c_up_12per'],1,0)
df1['c_shitf12_nei_flag'] = np.where((df1['close'].shift(12)> df1['c_down_12per']) & (df1['close'].shift(12)< df1['c_up_12per']),1,0)
df1['c_shitf12_down_flag'] = np.where(df1['close'].shift(12)< df1['c_down_12per'],1,0)
df1['c_shitf12_up_flag'] = np.where(df1['close'].shift(12)> df1['c_up_12per'],1,0)
df1['c_shitf13_nei_flag'] = np.where((df1['close'].shift(13)> df1['c_down_12per']) & (df1['close'].shift(13)< df1['c_up_12per']),1,0)
df1['c_shitf13_down_flag'] = np.where(df1['close'].shift(13)< df1['c_down_12per'],1,0)
df1['c_shitf13_up_flag'] = np.where(df1['close'].shift(13)> df1['c_up_12per'],1,0)
df1['c_shitf0_nei_flag'] = np.where((df1['close']> df1['c_down_12per']) & (df1['close']< df1['c_up_12per']),1,0)
df1['c_shitf0_down_flag'] = np.where(df1['close']< df1['c_down_12per'],1,0)
df1['c_shitf0_up_flag'] = np.where(df1['close']> df1['c_up_12per'],1,0)
df1['pan_nei_14count'] = df1['c_shitf1_nei_flag'] +df1['c_shitf2_nei_flag'] +df1['c_shitf3_nei_flag'] +df1['c_shitf4_nei_flag'] +df1['c_shitf5_nei_flag']
+df1['c_shitf6_nei_flag'] +df1['c_shitf7_nei_flag'] +df1['c_shitf8_nei_flag'] +df1['c_shitf9_nei_flag'] +df1['c_shitf10_nei_flag'] +df1['c_shitf11_nei_flag']
+df1['c_shitf12_nei_flag'] +df1['c_shitf13_nei_flag']
df1['pan_up_14count'] = df1['c_shitf1_up_flag'] +df1['c_shitf2_up_flag'] +df1['c_shitf3_up_flag'] +df1['c_shitf4_up_flag'] +df1['c_shitf5_up_flag']
+df1['c_shitf6_up_flag'] +df1['c_shitf7_up_flag'] +df1['c_shitf8_up_flag'] +df1['c_shitf9_up_flag'] +df1['c_shitf10_up_flag'] +df1['c_shitf11_up_flag']
+df1['c_shitf12_up_flag'] +df1['c_shitf13_up_flag']
df1['pan_down_14count'] = df1['c_shitf1_down_flag'] +df1['c_shitf2_down_flag'] +df1['c_shitf3_down_flag'] +df1['c_shitf4_down_flag'] +df1['c_shitf5_down_flag']
+df1['c_shitf6_down_flag'] +df1['c_shitf7_down_flag'] +df1['c_shitf8_down_flag'] +df1['c_shitf9_down_flag'] +df1['c_shitf10_down_flag'] +df1['c_shitf11_down_flag']
+df1['c_shitf12_down_flag'] +df1['c_shitf13_down_flag']