Administrator
2023-03-29 8ddc7f5ecc67c0bb424954a86b75ec7444080ba2
trade/first_code_score_manager.py
@@ -5,7 +5,7 @@
# bidding 是否满足竞价
# deal_big_money 成交大金额是否满足
# code_nature = (是否有涨停,是否有溢价)
# hot_block(板块中涨停票个数(包含自己),板块炸板票个数)
# hot_block(板块中涨停票个数(包含自己),板块炸板票个数, 新板块名称)
# zyltgb自由流通市值是否大于250亿
# limit_price 涨停价是否大于100块
# limit_up_time 是否10点之前涨停
@@ -24,7 +24,7 @@
    score_list = []
    if zyltgb:
        zyltgbs = [0, 10, 31, 51, 101, 150, 250, 1000000]
        zyltgb_score = [20, 30, 20, 10, 0, -10, -20]
        zyltgb_score = [20, 30, 20, 10, -1000, -1000, -1000]
        for i in range(1, len(zyltgbs)):
            if zyltgbs[i - 1] <= zyltgb / 100000000 < zyltgbs[i]:
                score_list.append(zyltgb_score[i - 1])
@@ -45,34 +45,34 @@
    k_score = []
    # 15个交易日是否涨幅24.9%
    if k_form[0]:
        k_score.append(-55)
        k_score.append(-1000)
    else:
        k_score.append(0)
    # 是否破前高
    if k_form[1]:
        k_score.append(65)
        k_score.append(55)
    else:
        k_score.append(0)
    # 是否超跌
    if k_form[2]:
        k_score.append(45)
        k_score.append(35)
    else:
        k_score.append(0)
    # 是否接近前高
    if k_form[3]:
        k_score.append(-25)
        k_score.append(-35)
    else:
        k_score.append(0)
    # 是否N
    if k_form[4]:
        k_score.append(40)
        k_score.append(30)
    else:
        k_score.append(0)
    # 是否V
    if k_form[5]:
        k_score.append(35)
        k_score.append(25)
    else:
        k_score.append(0)
@@ -80,7 +80,7 @@
    if k_form[6]:
        k_score.append(0)
    else:
        k_score.append(-25)
        k_score.append(-35)
    score_list.append(k_score)
@@ -103,15 +103,18 @@
    hot_block_score = []
    # 板块中只有自己涨停,且无炸板
    if hot_block[1] == 1 and hot_block[2] == 0:
        hot_block_score.append(25)
        hot_block_score.append(20)
    elif hot_block[1] >= 2 and hot_block[2] == 0:
        hot_block_score.append(35)
        hot_block_score.append(30)
    elif hot_block[3] and not k_form[6]:
        # 有新题材,且没有K线形态
        hot_block_score.append(30)
    else:
        hot_block_score.append(5)
        hot_block_score.append(0)
    score_list.append(hot_block_score)
    # 量
    volume_score = [0, 35, 45, 55, 45, 35, 15, -5, -30]
    volume_score = [0, 40, 50, 60, 50, 40, 20, 0, -25]
    volume_rates = [0, 0.349, 0.499, 0.649, 0.799, 0.949, 1.099, 1.249, 1.399]
    volume_add = False
    for i in range(1, len(volume_rates)):
@@ -124,7 +127,7 @@
    if limit_up_time:
        times = ["10:00:00", "11:30:00", "14:00:00", "15:00:00"]
        time_scores = [15, 10, 5, 0]
        time_scores = [5, 4, 3, 2]
        for i in range(0, len(times)):
            if int(times[i].replace(":", "")) >= int(limit_up_time.replace(":", "")):
                score_list.append(time_scores[i])
@@ -134,7 +137,7 @@
        # 大单成交
    if deal_big_money:
        score_list.append(30)
        score_list.append(35)
    else:
        score_list.append(0)
@@ -180,10 +183,10 @@
    hot_block = hot_block_data_process.get_info(code)
    if hot_block is None:
        hot_block = ('无板块', 1, 0)
        hot_block = ('无板块', 1, 0, None)
    else:
        # 加上自己
        hot_block = (hot_block[0], hot_block[1] + 1, hot_block[2])
        hot_block = (hot_block[0], hot_block[1] + 1, hot_block[2], hot_block[3])
    source_datas.append(hot_block)