コード例 #1
0
            # 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)
                    log.debug("len:%s" % (len(top_all)))
                    # codelist = top_all.index.tolist()
                    # log.info('toTDXlist:%s' % len(codelist))
コード例 #2
0
            #            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)