Esempio n. 1
0
 def get_code_list(self):
     try:
         stock_list = quotes.get_stock_hq_list()
         return stock_list["code"].tolist()
     except Exception as e:
         self.__logger.error(e)
         return []
Esempio n. 2
0
 def get_code_list(self):
     try:
         stock_list = quotes.get_stock_hq_list()
         return stock_list["code"].tolist()
     except Exception as e:
         self.__logger.error("get code list error:%s"%(e))
         return []
Esempio n. 3
0
def fetchBasicDataToMysql():
    stockList = quotes.get_stock_hq_list()
    stockCodeListAll = [stockList['code'][i:i + 100] for i in range(0, len(stockList['code']), 100)]
    threadList = []
    for stockCodeList in stockCodeListAll:
        t = threading.Thread(target=_fetchData, args=[stockCodeList, ])
        threadList.append(t)
    for t in threadList:
        t.start()
    for t in threadList:
        t.join()
def run():

    stockList = quotes.get_stock_hq_list()
    stockCodeListAll = [stockList['code'][i:i + 100] for i in range(0, len(stockList['code']), 100)]
    threadList = []
    for stockCodeList in stockCodeListAll:
        t = threading.Thread(target=batchUpdateMainReport,args=[stockCodeList,])
        threadList.append(t)
    for t in threadList:
        t.start()
    for t in threadList:
        t.join()
Esempio n. 5
0
def fetchBasicDataToMysql():
    stockList = quotes.get_stock_hq_list()
    stockCodeListAll = [
        stockList['code'][i:i + 100]
        for i in range(0, len(stockList['code']), 100)
    ]
    threadList = []
    for stockCodeList in stockCodeListAll:
        t = threading.Thread(target=_fetchData, args=[
            stockCodeList,
        ])
        threadList.append(t)
    for t in threadList:
        t.start()
    for t in threadList:
        t.join()
def run():

    stockList = quotes.get_stock_hq_list()
    stockCodeListAll = [
        stockList['code'][i:i + 100]
        for i in range(0, len(stockList['code']), 100)
    ]
    threadList = []
    for stockCodeList in stockCodeListAll:
        t = threading.Thread(target=batchUpdateMainReport,
                             args=[
                                 stockCodeList,
                             ])
        threadList.append(t)
    for t in threadList:
        t.start()
    for t in threadList:
        t.join()
Esempio n. 7
0
        if report_list[key]['profits_yoy']:
            year_grow.append(report_list[key]['profits_yoy'])
    quarter_grow = []
    for key in last_two_quarter:
        if report_list[key]['profits_yoy']:
            quarter_grow.append(report_list[key]['profits_yoy'])

    if (sum(year_grow)/3)!=0 and (max(quarter_grow) - sum(year_grow)/3)/abs((sum(year_grow)/3)) > 1:
        return True,quarter_grow,year_grow
    return False,quarter_grow,year_grow
        
if __name__ == "__main__":
    
    
    
    stokList = quotes.get_stock_hq_list()
    data_list = []
    for i in stokList.index:
        try:
            flag, quarter_grow,year_grow = check_stock(stokList.loc[i,"code"])
            if flag:
                data = {"code":stokList.loc[i,"code"],"quarter_grow1":quarter_grow[0],"quarter_grow2":quarter_grow[1],\
                        "year_grow1":year_grow[0],"year_grow2":year_grow[1],"year_grow3":year_grow[2],"mktcap":stokList.loc[i,"mktcap"],\
                        "name":stokList.loc[i,"name"]}
                data_list.append(data)
        except:
            continue
    mongo = Mongo()
    db = mongo.getDB()
    db["guaidian_list"].remove()
    db["guaidian_list"].insert(data_list)