def get_days_data(days=0):
     rzrq_status=1
     # data=''
     da=0
     while rzrq_status:
         for x in range(0,20):
             yestoday=cct.last_tddate(x).replace('-','/')
             data2=get_tzrq(url,yestoday)
             if len(data2)>0:
                 if da ==days and days==0:
                     break
                 elif da > days:
                     break
                 da+=1
                 # print da
             else:
                 log.info("%s:%s"%(yestoday,data2))
         rzrq_status=0
     log.info("%s:%s"%(yestoday,data2))
     return data2    
Exemple #2
0
    def get_days_data(days=1):
        rzrq_status = 1
        # data=''
        da = 0
        i = 0
        while rzrq_status:
            for x in range(days, 20):
                yestoday = cct.last_tddate(x).replace('-', '/')
                data2 = get_tzrq(url, yestoday)
                log.info("yestoday:%s data:%s" % (yestoday, data2))
                if len(data2) > 0:
                    i += 1
                    # if da ==days and days==0:
                    # i +=1
#                    if i >= days-1:
                    break
                    # elif da > days:
                        # break
                # else:    da+=1
                    # print da
                else:
                    log.info("%s:%s" % (yestoday, data2))
            rzrq_status = 0
        return data2
Exemple #3
0
 # blkname = '062.blk'
 blkname = '061.blk'
 block_path = tdd.get_tdx_dir_blocknew() + blkname
 status_change = False
 lastpTDX_DF = pd.DataFrame()
 # dl=60
 ptype = 'high'
 lastp = False
 newdays = 30
 # op, ra, duration_date, days = pct.get_linear_model_status('999999', filter='y', dl=dl, ptype=ptype, days=1)
 #    duration_date = ct.duration_date
 duration_date = ct.duration_date_l
 du_date = duration_date
 # print cct.last_tddate(2)
 # end_date = cct.last_tddate(days=int(duration_date/4))
 end_date = cct.last_tddate(days=ct.lastdays)
 ptype = 'high'
 filter = 'y'
 if len(str(duration_date)) < 4:
     # duration_date = tdd.get_duration_price_date('999999', dl=duration_date, end=end_date, ptype='dutype')
     du_date = tdd.get_duration_Index_date('999999', dl=duration_date)
     if cct.get_today_duration(du_date) <= 3:
         duration_date = 5
         print("duaration: %s duration_date:%s" %
               (cct.get_today_duration(du_date), duration_date))
     log.info("duaration: %s duration_date:%s" %
              (cct.get_today_duration(du_date), duration_date))
 set_duration_console(du_date)
 percent_status = 'n'
 # all_diffpath = tdd.get_tdx_dir_blocknew() + '062.blk'
 parser = cct.MoniterArgmain()
Exemple #4
0
 type = ct.json_countType
 # cut_num=10000
 success = 0
 top_all = pd.DataFrame()
 time_s = time.time()
 # delay_time = 3600
 delay_time = cct.get_delay_time()
 First = True
 # base_path = tdd.get_tdx_dir()
 # block_path = tdd.get_tdx_dir_blocknew() + '067.blk'
 # blkname = '067.blk'
 blkname = '063.blk'
 block_path = tdd.get_tdx_dir_blocknew() + blkname
 lastpTDX_DF = pd.DataFrame()
 duration_date = ct.duration_date_l
 end_date = cct.last_tddate(days=3)
 # all_diffpath = tdd.get_tdx_dir_blocknew() + '062.blk'
 market_sort_value = ct.Market_sort_idx['1']
 market_sort_value_key = eval(market_sort_value + '_key')
 while 1:
     try:
         # top_now = tdd.getSinaAlldf(market='sh', vol=ct.json_countVol, vtype=ct.json_countType)
         time_Rt = time.time()
         # top_now = tdd.getSinaAlldf(market='次新股',filename='cxg', vol=ct.json_countVol, vtype=ct.json_countType)
         top_now = tdd.getSinaAlldf(market='cyb',
                                    filename=None,
                                    vol=ct.json_countVol,
                                    vtype=ct.json_countType)
         # print top_now.loc['300208','name']
         df_count = len(top_now)
         now_count = len(top_now)