top_temp = pct.powerCompute_df(top_temp, dl=ct.PowerCountdl, talib=True, newdays=newdays) top_end = pct.powerCompute_df(top_end, dl=ct.PowerCountdl, talib=True, newdays=newdays) else: # top_dif = top_dif[top_dif.percent >= 0] top_end = top_dif[:5].copy() top_temp = top_dif[-ct.PowerCount:].copy() top_temp = pct.powerCompute_df(top_temp, dl=ct.PowerCountdl, talib=True, newdays=newdays) top_end = pct.powerCompute_df(top_end, dl=ct.PowerCountdl, talib=True, newdays=newdays) cct.set_console(width, height, title=[du_date, 'dT:%s' % cct.get_time_to_date(time_s), 'G:%s' % goldstock, 'zxg: %s' % (blkname+'-'+market_blk)]) top_all = tdd.get_powerdf_to_all(top_all, top_temp) top_all = tdd.get_powerdf_to_all(top_all, top_end) top_temp = stf.getBollFilter(df=top_temp, boll=ct.bollFilter, duration=ct.PowerCountdl,resample=resample) print("N:%s K:%s %s G:%s" % ( now_count, len(top_all[top_all['buy'] > 0]), len(top_now[top_now['volume'] <= 0]), goldstock)), 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_temp = pct.powerCompute_df(top_temp, dl=ct.PowerCountdl) goldstock = len( top_all[(top_all.buy >= top_all.lhigh * 0.99) & (top_all.buy >= top_all.llastp * 0.99)]) # print "G:%s Rt:%0.1f dT:%s N:%s" % (len(top_all),float(time.time() - # time_Rt),cct.get_time_to_date(time_s),cct.get_now_time()) cct.set_console(width, height, title=[ 'dT:%s' % cct.get_time_to_date(time_s), 'G:%s' % len(top_all), 'zxg: %s' % (blkname + '-' + market_blk) ]) top_all = tdd.get_powerdf_to_all(top_all, top_temp) top_temp = stf.getBollFilter(df=top_temp, boll=1) print "G:%s Rt:%0.1f dT:%s N:%s T:%s" % ( goldstock, float(time.time() - time_Rt), cct.get_time_to_date(time_s), cct.get_now_time(), len(top_temp)) if 'op' in top_temp.columns: # top_temp = top_temp.sort_values(by=['ra','op','couts'],ascending=[0, 0,0]) # top_temp = top_temp.sort_values(by=['dff', 'op', 'ra', 'percent', 'ratio'], # top_temp = top_temp.sort_values(by=ct.Monitor_sort_op, # ascending=ct.Monitor_sort_op_key) # top_temp = top_temp.sort_values(by=ct.Duration_percentdn_ra, # 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),
else: # top_dif = top_dif[top_dif.percent >= 0] top_end = top_dif[:5].copy() top_temp = top_dif[-ct.PowerCount:].copy() top_temp = pct.powerCompute_df(top_temp, dl=ct.PowerCountdl, talib=True, newdays=newdays) top_end = pct.powerCompute_df(top_end, dl=ct.PowerCountdl, talib=True, newdays=newdays) cct.set_console(width, height, title=[du_date, 'dT:%s' % cct.get_time_to_date(time_s), 'G:%s' % goldstock, 'zxg: %s' % (blkname+'-'+market_blk)]) # print len(top_all),top_all.shape top_all = tdd.get_powerdf_to_all(top_all, top_temp) top_all = tdd.get_powerdf_to_all(top_all, top_end) # top_temp = stf.getBollFilter(df=top_temp, boll=ct.bollFilter,duration=ct.PowerCountdl, filter=True, percent=True, resample=resample) # top_temp = stf.getBollFilter(df=top_temp, boll=ct.bollFilter,duration=ct.PowerCountdl, filter=True, percent=True, resample=resample) top_temp = stf.getBollFilter(df=top_temp, boll=ct.bollFilter, duration=ct.PowerCountdl, filter=True, ma5d=False, dl=14, percent=False, resample=resample, ene=False,cuminTrend=False) # top_end = stf.getBollFilter(df=top_temp, boll=ct.bollFilter, duration=ct.PowerCountdl, filter=False, ma5d=False, dl=14, percent=False, resample=resample, ene=False) print(("N:%s K:%s %s G:%s" % ( now_count, len(top_all[top_all['buy'] > 0]), len(top_now[top_now['volume'] <= 0]), goldstock)), end=' ') nhigh = top_temp[top_temp.close > top_temp.nhigh] if 'nhigh' in top_temp.columns.values else [] nlow = top_temp[top_temp.close > top_temp.nlow] if 'nlow' in top_temp.columns.values else [] print("Rt:%0.1f dT:%s N:%s T:%s %s%% nh:%s nlow:%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),len(nhigh),len(nlow))) # top_end = stf.getBollFilter(df=top_end, boll=ct.bollFilter,duration=ct.PowerCountdl,filter=False) if 'op' in top_temp.columns: # if ptype == 'low': # top_temp = top_temp.sort_values(by=ct.Duration_sort_op, # ascending=ct.Duration_sort_op_key) # else:
# top_temp = stf.filterPowerCount(top_temp,ct.PowerCount,down=True) top_end=top_all[-int((ct.PowerCount) / 10):].copy() top_temp=pct.powerCompute_df(top_temp, dl=ct.PowerCountdl) top_end=pct.powerCompute_df(top_end, dl=ct.PowerCountdl) goldstock=len(top_all[( top_all.buy >= top_all.lhigh * 0.99) & (top_all.buy >= top_all.llastp * 0.99)]) top_all=tdd.get_powerdf_to_all(top_all, top_temp) # 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:
height, title=[ du_date, 'dT:%s' % cct.get_time_to_date(time_s), 'G:%s' % goldstock, 'zxg: %s' % (blkname + '-' + market_blk) ]) top_all = tdd.get_powerdf_to_all(top_all, top_temp) top_all = tdd.get_powerdf_to_all(top_all, top_end) top_temp = stf.getBollFilter(df=top_temp, boll=ct.bollFilter, duration=ct.PowerCountdl, resample=resample, ene=True, upper=True, cuminTrend=False) print(("N:%s K:%s %s G:%s" % (now_count, len(top_all[top_all['buy'] > 0]), len(top_now[top_now['volume'] <= 0]), goldstock)), end=' ') print( "Rt:%0.1f dT:%s N:%s T:%s %0.1f%%" % (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:
goldstock = len( top_dif[(top_dif.buy >= top_dif.lhigh * 0.99) & (top_dif.buy >= top_dif.llastp * 0.99)]) cct.set_console(width, height, title=[ 'dT:%s' % cct.get_time_to_date(time_s), 'G:%s' % len(top_dif), 'zxg: %s' % (blkname) ]) top_all = tdd.get_powerdf_to_all(top_all, top_temp) # top_temp = stf.getBollFilter(df=top_temp, boll=ct.bollFilter,duration=ct.PowerCountdl) top_temp = stf.getBollFilter(df=top_temp, boll=-10, duration=ct.PowerCountdl) print( "A:%s N:%s K:%s %s G:%s" % (df_count, now_count, len(top_all[top_all['buy'] > 0]), len(top_now[top_now['volume'] <= 0]), goldstock)), # print "Rt:%0.3f" % (float(time.time() - time_Rt)) 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) / now_count * 100, 1)) if 'op' in top_temp.columns: if duration_date > ct.duration_date_sort: top_temp = top_temp.sort_values(
newdays=newdays) cct.set_console(width, height, title=[ du_date, 'dT:%s' % cct.get_time_to_date(time_s), 'G:%s' % goldstock, 'zxg: %s' % (blkname) ]) # print len(top_all),top_all.shape top_all = tdd.get_powerdf_to_all(top_all, top_temp) top_all = tdd.get_powerdf_to_all(top_all, top_end) top_temp = stf.getBollFilter(df=top_temp, boll=ct.bollFilter, duration=ct.PowerCountdl, filter=True, percent=True) print("N:%s K:%s %s G:%s" % (now_count, len(top_all[top_all['buy'] > 0]), len(top_now[top_now['volume'] <= 0]), goldstock)), 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) / now_count * 100, 1)) # top_end = stf.getBollFilter(df=top_end, boll=ct.bollFilter,duration=ct.PowerCountdl,filter=False) if 'op' in top_temp.columns: # if ptype == 'low': # top_temp = top_temp.sort_values(by=ct.Duration_sort_op, # ascending=ct.Duration_sort_op_key)
if len(top_all[top_all.dff > 0]) == 0: top_all['dff'] = (map( lambda x, y: round((x - y) / y * 100, 1), top_all['buy'].values, top_all['lastp'].values)) top_temp = top_all[:ct.PowerCount].copy() top_temp = pct.powerCompute_df(top_temp, dl=ct.PowerCountdl) goldstock = len( top_all[(top_all.buy >= top_all.lhigh * 0.99) & (top_all.buy >= top_all.llastp * 0.99)]) top_all = tdd.get_powerdf_to_all(top_all, top_temp) top_temp = stf.getBollFilter(df=top_temp, boll=ct.bollFilter, duration=ct.PowerCountdl, filter=False) print "G:%s Rt:%0.1f dT:%s N:%s T:%s" % ( goldstock, float(time.time() - time_Rt), cct.get_time_to_date(time_s), cct.get_now_time(), len(top_temp)) if 'op' in top_temp.columns: # top_temp = top_temp.sort_values(by=['ra','percent','couts'],ascending=[0, 0,0]) # top_temp = top_temp.sort_values(by=ct.Monitor_sort_op, # ascending=ct.Monitor_sort_op_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=eval(market_sort_value),