Ejemplo n.º 1
0
def save_industry_classified_top(stockinfo, rank):
    old = session.query(GoodStock).filter(GoodStock.code == stockinfo.code).first()
    if old is None:
        old = GoodStock(code=stockinfo.code, name=stockinfo.name)
    # 重点关注
    old.industry_classified_top = "龙头排名" + str(rank)
    old.industry_classified = stockinfo.industry_classified
    add(old)
Ejemplo n.º 2
0
def save_industry_top(stockinfo, rank):
    old = getSession().query(GoodStock).filter(
        GoodStock.code == stockinfo.code).first()
    if old is None:
        old = GoodStock(code=stockinfo.code, name=stockinfo.name)
    # 重点关注
    old.industry_top = "龙头排名" + str(rank)
    old.industry = stockinfo.industry
    save(old)
Ejemplo n.º 3
0
def save_blue_chip(stockinfo, blue_chip_flag):
    old = session.query(GoodStock).filter(GoodStock.code == stockinfo.code).first()
    if old is None:
        old = GoodStock(code=stockinfo.code, name=stockinfo.name)
    if old.blue_chip == '蓝筹' and blue_chip_flag != 1:
        # 之前是蓝筹,现在不是
        old.notice = '之前是蓝筹,现在不是了'
    # 推荐股票
    if blue_chip_flag == 1:
        old.blue_chip = "蓝筹"
    elif blue_chip_flag == 0:
        old.blue_chip = ''
    elif blue_chip_flag == -1:
        #old.blue_chip = "蓝筹"
        if old.notice is None:
            old.notice = ''
        if old.notice.find('财报信息不全') < 0:
            old.notice += '财报信息不全'
    old.industry_classified = stockinfo.industry_classified
    add(old)