# top_now.to_hdf("testhdf5", 'marketDD', format='table', complevel=9) now_count = len(top_now) radio_t = cct.get_work_time_ratio() # top_now = top_now[top_now.buy > 0] time_d = time.time() if time_d - time_s > delay_time: status_change = True time_s = time.time() top_all = pd.DataFrame() else: status_change = False # print ("Buy>0:%s" % len(top_now[top_now['buy'] > 0])), if len(top_now) > 10 or cct.get_work_time(): time_Rt = time.time() if len(top_all) == 0 and len(lastpTDX_DF) == 0: cct.get_terminal_Position(position=sys.argv[0]) time_Rt = time.time() top_all, lastpTDX_DF = tdd.get_append_lastp_to_df( top_now, lastpTDX_DF=None, dl=duration_date, end=end_date, ptype=ptype, filter=filter, power=ct.lastPower, lastp=False, newdays=newdays, resample=resample) log.debug("len:%s" % (len(top_all))) # codelist = top_all.index.tolist() # log.info('toTDXlist:%s' % len(codelist)) # # tdxdata = tdd.get_tdx_all_day_LastDF(codelist,dt=duration_date,ptype=ptype) # # print "duration_date:%s ptype=%s filter:%s"%(duration_date, ptype,filter) # # tdxdata = tdd.get_tdx_exp_all_LastDF(codelist, dt=duration_date, end=end_date,ptype=ptype,filter=filter) # power=True # log.debug("TdxLastP: %s %s" % (len(tdxdata), tdxdata.columns.values)) # tdxdata.rename(columns={'low': 'llow'}, inplace=True) # tdxdata.rename(columns={'high': 'lhigh'}, inplace=True) # tdxdata.rename(columns={'close': 'lastp'}, inplace=True)
now_count = len(top_now) radio_t = cct.get_work_time_ratio() # top_now = top_now[top_now.buy > 0]` time_d = time.time() if time_d - time_s > delay_time: status_change = True time_s = time.time() top_all = pd.DataFrame() else: status_change = False # print ("Buy>0:%s" % len(top_now[top_now['buy'] > 0])), if len(top_now) > 10 or cct.get_work_time(): time_Rt = time.time() if len(top_all) == 0 and len(lastpTDX_DF) == 0: cct.get_terminal_Position(position=sys.argv[0]) time_Rt = time.time() print(("term:%s" % (cct.get_terminal_Position(cmd='DurationCXDN.py')),)) if cct.get_terminal_Position(cmd='DurationCXDN.py') > 1: top_all, lastpTDX_DF = tdd.get_append_lastp_to_df( top_now, lastpTDX_DF=None, dl=duration_date, end=end_date, ptype=ptype, filter=filter, power=ct.lastPower, lastp=False, newdays=newdays, checknew=True,resample=resample) else: newdays = 15 top_all, lastpTDX_DF = tdd.get_append_lastp_to_df( top_now, lastpTDX_DF=None, dl=duration_date, end=end_date, ptype=ptype, filter=filter, power=ct.lastPower, lastp=False, newdays=newdays, checknew=True, resample=resample) # top_all, lastpTDX_DF = tdd.get_append_lastp_to_df( # top_now, lastpTDX_DF=None, dl=duration_date, end=end_date, ptype=ptype, filter=filter, power=False, lastp=False, newdays=newdays, resample=resample)
# # print 'sina_Monitor-Market-LH.py:',getPosition('sina_Monitor-Market-LH.py') print "sina_Market-DurationUP.py:", getPosition( 'sina_Market-DurationUP.py') # # print 'sina_Market-DurationSH.py:',getPosition('sina_Market-DurationSH.py') # print 'sina_Market-DurationCXDN.py:',getPosition('sina_Market-DurationCXDN.py') # # print 'sina_Market-DurationCXUP.py:',getPosition('sina_Market-DurationCXUP.py') # # print 'sina_Market-DurationDnUP.py:',getPosition('sina_Market-DurationDnUP.py') # # print 'sina_Monitor-GOLD.py:',getPosition('sina_Monitor-GOLD.py') # print 'sina_Monitor.py:',getPosition('sina_Monitor.py') print getPosition('LinePower.py') print getPosition('Johnson', close=True) print getPosition('/Users/Johnson/Documents', close=True) else: setPosition(cmd=None, position=None) cct.get_terminal_Position(cct.clean_terminal[2], close=True) cct.get_terminal_Position(cct.clean_terminal[1], close=True) cct.get_terminal_Position(cmd=cct.scriptquit, position=None, close=False) # getPosition('Johnson —',close=True) # getPosition('Johnson —',close=True) # getPosition('Johnson — python',close=True) # getPosition('Johnson — osasc',close=True) print getPosition('Johnson — python', close=True) else: print("win") #positionKey = cct.terminal_positionKey_triton if hostname.find('R900') >= 0: positionKey = cct.terminal_positionKey2K_R9000P
# top_now.to_hdf("testhdf5", 'marketDD', format='table', complevel=9) now_count = len(top_now) radio_t = cct.get_work_time_ratio() # top_now = top_now[top_now.buy > 0] time_d = time.time() if time_d - time_s > delay_time: status_change = True time_s = time.time() top_all = pd.DataFrame() else: status_change = False # print ("Buy>0:%s" % len(top_now[top_now['buy'] > 0])), if len(top_now) > 10 or cct.get_work_time(): # time_Rt = time.time() if len(top_all) == 0 and len(lastpTDX_DF) == 0: cct.get_terminal_Position(position=sys.argv[0]) print(("term:%s" % (cct.get_terminal_Position(cmd='DurationSH.py')), )) if cct.get_terminal_Position(cmd='DurationSH.py') > 1: top_all, lastpTDX_DF = tdd.get_append_lastp_to_df( top_now, lastpTDX_DF=None, dl=duration_date, end=end_date, ptype=ptype, filter=filter, power=ct.lastPower, lastp=False, newdays=newdays, resample=resample) else:
# top_now = tdd.getSinaAlldf(market=u'次新股',filename='cxg', vol=ct.json_countVol, vtype=ct.json_countType) now_count = len(top_now) radio_t = cct.get_work_time_ratio() # top_now = top_now[top_now.buy > 0] time_d = time.time() if time_d - time_s > delay_time: status_change = True time_s = time.time() top_all = pd.DataFrame() else: status_change = False # print ("Buy>0:%s" % len(top_now[top_now['buy'] > 0])), if len(top_now) > 0 or cct.get_work_time(): # time_Rt = time.time() if len(top_all) == 0 and len(lastpTDX_DF) == 0: cct.get_terminal_Position(position=sys.argv[0]) # time_Rt = time.time() print "term:%s" % (cct.get_terminal_Position(cmd='DurationDn.py')), # if cct.get_terminal_Position(cmd='DurationDn.py') > 1: # top_all, lastpTDX_DF = tdd.get_append_lastp_to_df( # top_now, lastpTDX_DF=None, dl=duration_date, end=end_date, ptype=ptype, filter=filter, power=ct.lastPower, lastp=lastp, newdays=newdays, resample=resample) # else: newdays = 0 top_all, lastpTDX_DF = tdd.get_append_lastp_to_df( top_now, lastpTDX_DF=None, dl=duration_date, end=end_date, ptype=ptype, filter=filter, power=ct.lastPower, lastp=lastp, newdays=newdays, checknew=True, resample=resample) # codelist = top_all.index.tolist() # log.info('toTDXlist:%s' % len(codelist)) # # tdxdata = tdd.get_tdx_all_day_LastDF(codelist,dt=duration_date,ptype=ptype) # # print "duration_date:%s ptype=%s filter:%s"%(duration_date, ptype,filter)
# top_now = tdd.getSinaAlldf(market=u'次新股',filename='cxg', vol=ct.json_countVol, vtype=ct.json_countType) now_count = len(top_now) radio_t = cct.get_work_time_ratio() # top_now = top_now[top_now.buy > 0] time_d = time.time() if time_d - time_s > delay_time: status_change = True time_s = time.time() top_all = pd.DataFrame() else: status_change = False # print ("Buy>0:%s" % len(top_now[top_now['buy'] > 0])), if len(top_now) > 0 or cct.get_work_time(): # time_Rt = time.time() if len(top_all) == 0 and len(lastpTDX_DF) == 0: cct.get_terminal_Position(position=sys.argv[0]) # time_Rt = time.time() print("term:%s" % (cct.get_terminal_Position(cmd='DurationDn.py')), end=' ') # if cct.get_terminal_Position(cmd='DurationDn.py') > 1: # top_all, lastpTDX_DF = tdd.get_append_lastp_to_df( # top_now, lastpTDX_DF=None, dl=duration_date, end=end_date, ptype=ptype, filter=filter, power=ct.lastPower, lastp=lastp, newdays=newdays, resample=resample) # else: newdays = 0 top_all, lastpTDX_DF = tdd.get_append_lastp_to_df( top_now, lastpTDX_DF=None, dl=duration_date, end=end_date,