print "Rt:%0.1f dT:%s N:%s T:%s %s%%" % (float(time.time() - time_Rt), cct.get_time_to_date(time_s), cct.get_now_time(), len(top_temp), round(len(top_temp) / float(ct.PowerCount) * 100, 1)) # top_end = stf.getBollFilter(df=top_end, boll=ct.bollFilter,duration=ct.PowerCountdl) if 'op' in top_temp.columns: if cct.get_now_time_int() > ct.checkfilter_end_timeDu and (int(duration_date) > int(ct.duration_date_sort) or int(duration_date) < ct.duration_diff): top_temp = top_temp.sort_values(by=eval(market_sort_value), ascending=market_sort_value_key) else: top_temp = top_temp.sort_values(by=eval(market_sort_value), ascending=market_sort_value_key) if cct.get_now_time_int() > 915 and cct.get_now_time_int() < 935: # top_temp = top_temp[ (top_temp['ma5d'] > top_temp['ma10d']) & (top_temp['buy'] > top_temp['ma10d']) ][:10] top_dd = cct.combine_dataFrame(top_temp[:10], top_end,append=True, clean=True) # top_dd = top_dd.drop_duplicates() ct_Duration_format_Values = ct.get_Duration_format_Values(ct.Duration_format_buy, market_sort_value[:]) top_dd = top_dd.loc[:, ct_Duration_format_Values] else: # top_temp = top_temp[ (top_temp['ma5d'] > top_temp['ma10d']) & (top_temp['trade'] > top_temp['ma10d']) ][:10] # top_temp = top_temp[top_temp['trade'] > top_temp['ma10d']] top_dd = cct.combine_dataFrame(top_temp[:10], top_end,append=True, clean=True) # top_dd = top_dd.drop_duplicates() ct_Duration_format_Values = ct.get_Duration_format_Values(ct.Duration_format_trade, market_sort_value[:]) top_dd = top_dd.loc[:, ct_Duration_format_Values] print cct.format_for_print(top_dd) # dfgui.show(top_dif) # if cct.get_now_time_int() < 930 or cct.get_now_time_int() > 1505 or (cct.get_now_time_int() > 1125 and cct.get_now_time_int() < 1505): # print cct.format_for_print(top_dif[-10:]) # print top_all.loc['000025',:] # print "staus",status
else: top_temp = top_temp.sort_values(by=(market_sort_value), ascending=market_sort_value_key) if st_key_sort.split()[0] == 'x': top_temp = top_temp[top_temp.topR != 0] if cct.get_now_time_int() > 915 and cct.get_now_time_int() < 935: # top_temp = top_temp[top_temp['buy'] > top_temp['ma10d']] # top_temp = top_temp[top_temp['ma5d'] > top_temp['ma10d']][:10] # top_temp = top_temp[ (top_temp['ma5d'] > top_temp['ma10d']) & (top_temp['buy'] > top_temp['ma10d']) ][:10] top_dd = cct.combine_dataFrame(top_temp[:10], top_end[:5],append=True, clean=True) # top_dd = top_dd.drop_duplicates() ct_Duration_format_Values = ct.get_Duration_format_Values(ct.Duration_format_buy, market_sort_value[:]) else: # top_temp = top_temp[top_temp['trade'] > top_temp['ma10d']] # top_temp = top_temp[top_temp['ma5d'] > top_temp['ma10d']][:10] # top_temp = top_temp[ (top_temp['ma5d'] > top_temp['ma10d']) & (top_temp['trade'] > top_temp['ma10d']) ][:10] top_dd = cct.combine_dataFrame(top_temp[:10], top_end[:5],append=True, clean=True) ct_Duration_format_Values = ct.get_Duration_format_Values(ct.Duration_format_trade, market_sort_value[:]) # ct_Duration_format_Values = ct.get_Duration_format_Values(ct_Duration_format_Values,replace='couts',dest='stdv') # ct_Duration_format_Values = ct.get_Duration_format_Values(ct_Duration_format_Values,replace='boll',dest='upper') if 'b1_v' in ct_Duration_format_Values: ct_Duration_format_Values = ct.get_Duration_format_Values(ct_Duration_format_Values,replace='b1_v',dest='perc3d') ct_Duration_format_Values = ct.get_Duration_format_Values(ct_Duration_format_Values,replace='couts',dest='b1_v')
# top_temp = stf.getBollFilter(df=top_temp, boll=ct.bollFilter, duration=ct.PowerCountdl, filter=False) # top_temp = stf.getBollFilter(df=top_temp, boll=ct.bollFilter, duration=ct.PowerCountdl, filter=False, ma5d=False, dl=14, percent=False, resample='d') # top_temp = stf.getBollFilter(df=top_temp, boll=ct.bollFilter, duration=ct.PowerCountdl, filter=True, ma5d=True, dl=14, percent=False, resample=resample) top_temp=stf.getBollFilter( df=top_temp, resample=resample, down=True) top_end=stf.getBollFilter( df=top_end, resample=resample, down=True) nhigh = top_temp[top_temp.close > top_temp.nhigh] if 'nhigh' in top_temp.columns else [] nlow = top_temp[top_temp.close > top_temp.nlow] if 'nlow' in top_temp.columns else [] print("G:%s Rt:%0.1f dT:%s N:%s T:%s nh:%s nlow:%s" % (goldstock, float(time.time() - time_Rt), cct.get_time_to_date(time_s), cct.get_now_time(), len(top_temp),len(nhigh),len(nlow))) top_temp=top_temp.sort_values(by=(market_sort_value), ascending=market_sort_value_key) ct_MonitorMarket_Values=ct.get_Duration_format_Values( ct.Monitor_format_trade, market_sort_value[:2]) if len(st_key_sort.split()) < 2: f_sort=(st_key_sort.split()[0] + ' f ') else: if st_key_sort.find('f') > 0: f_sort=st_key_sort else: f_sort=' '.join(x for x in st_key_sort.split()[ :2]) + ' f ' + ' '.join(x for x in st_key_sort.split()[2:]) market_sort_value2, market_sort_value_key2=ct.get_market_sort_value_key( f_sort, top_all=top_all) # ct_MonitorMarket_Values2=ct.get_Duration_format_Values( # ct.Monitor_format_trade, market_sort_value2[:2])
# ascending=ct.Duration_percentdn_ra_key) # top_temp = top_temp.sort_values(by=ct.Duration_percent_op, # ascending=ct.Duration_percent_op_key) top_temp = top_temp.sort_values( by=(market_sort_value), ascending=market_sort_value_key) # top_temp = top_temp.sort_values(by=['op','ra','dff', 'percent', 'ratio'], ascending=[0,0,0, 0, 1]) # if cct.get_now_time_int() > 915 and cct.get_now_time_int() < 935: # top_temp = top_temp.loc[:,ct.Monitor_format_trade] # else: # top_temp = top_temp.loc[:,ct.Monitor_format_trade] if st_key_sort.split()[0] == 'x': top_temp = top_temp[top_temp.topR != 0] ct_MonitorMarket_Values = ct.get_Duration_format_Values( ct.Monitor_format_trade, market_sort_value[:2]) print cct.format_for_print( top_temp.loc[:, ct_MonitorMarket_Values][:10]) # print cct.format_for_print(top_all[:10]) if status: for code in top_all[:10].index: code = re.findall('(\d+)', code) if len(code) > 0: code = code[0] kind = sl.get_multiday_ave_compare_silent(code) else: # print top_now[:10] print "\tNo data" int_time = cct.get_now_time_int() if cct.get_work_time():
by=(market_sort_value), ascending=market_sort_value_key) if st_key_sort.split()[0] == 'x': top_temp = top_temp[top_temp.topR != 0] if cct.get_now_time_int() > 915 and cct.get_now_time_int( ) < 935: # top_temp = top_temp[top_temp['ma5d'] > top_temp['ma10d']][:10] # top_temp = top_temp[ (top_temp['ma5d'] > top_temp['ma10d']) & (top_temp['buy'] > top_temp['ma10d']) ][:10] top_dd = cct.combine_dataFrame(top_temp[:10], top_end, append=True, clean=True) # top_dd = top_dd.drop_duplicates() ct_Duration_format_Values = ct.get_Duration_format_Values( ct.Duration_format_buy, market_sort_value[:]) else: # top_temp = top_temp[top_temp['trade'] > top_temp['ma10d']] # top_temp = top_temp[top_temp['ma5d'] > top_temp['ma10d']][:10] # top_temp = top_temp[ (top_temp['ma5d'] > top_temp['ma10d']) & (top_temp['trade'] > top_temp['ma10d']) ][:10] top_dd = cct.combine_dataFrame(top_temp[:10], top_end, append=True, clean=True) # top_dd = top_dd.drop_duplicates() ct_Duration_format_Values = ct.get_Duration_format_Values( ct.Duration_format_trade, market_sort_value[:]) # ct_Duration_format_Values = ct.get_Duration_format_Values(ct_Duration_format_Values,replace='couts',dest='stdv') ct_Duration_format_Values = ct.get_Duration_format_Values( ct_Duration_format_Values,