| | |
| | | import global_util |
| | | import gpcode_manager |
| | | import tool |
| | | from third_data import hot_block_data_process |
| | | from third_data import block_info |
| | | from trade import l2_trade_factor, deal_big_money_manager, bidding_money_manager |
| | | |
| | | |
| | | # 获取几板 |
| | | def __get_ban_count(str_): |
| | | for i in range(len(str_)-1, -1, -1): |
| | | if str_[i].isnumeric(): |
| | | return int(str_[i]) |
| | | return 0 |
| | | |
| | | |
| | | def __get_score(zyltgb, limit_price, bidding, k_form, code_nature, hot_block, volume_rate, limit_up_time, |
| | |
| | | if zyltgb_y <= 80: |
| | | score_list.append(max(int(round(0.5 * zyltgb_y - 10, 0)), -10)) |
| | | else: |
| | | score_list.append(max(int(round(30 - 5 * ((zyltgb_y-80)//20), 0)), -10)) |
| | | score_list.append(max(int(round(30 - 5 * ((zyltgb_y - 80) // 20), 0)), -10)) |
| | | else: |
| | | score_list.append(0) |
| | | |
| | |
| | | # 板块 - 代码平均涨幅 |
| | | __average_rate = round(hot_block["block_codes_rates_info"][0] / hot_block["block_codes_rates_info"][1], 2) |
| | | if hot_block["target_block_info"][0] == "无板块": |
| | | hot_block_score.append(5) |
| | | else: |
| | | hot_block_score.append(min(int(round(__average_rate * 2 - 10)), 10)) |
| | | # 板块 - 涨停只数 |
| | | if hot_block["limit_up_codes_count"] <= 1: |
| | | hot_block_score.append(1) |
| | | else: |
| | | hot_block_score.append(max(12 - hot_block["limit_up_codes_count"], 2)) |
| | | # 板块 - 板块涨幅 |
| | | hot_block_score.append(min(int(round(hot_block["target_block_info"][1] * 2)), 10)) |
| | | # 板块 - 第几只涨停 |
| | | if hot_block["limit_up_index"] <= 0: |
| | | # 无板块的板块得分只能是25 |
| | | hot_block_score.append(25) |
| | | # 补充多余数据 |
| | | for i in range(10): |
| | | hot_block_score.append(0) |
| | | else: |
| | | hot_block_score.append(max(60 - hot_block["limit_up_index"] * 5, 10)) |
| | | # 板块 - 高位板 |
| | | high_score = 0 |
| | | for high_info in hot_block["high_block_infos"]: |
| | | c_count = int(high_info[1][-2:-1]) |
| | | high_score += min(2 * c_count - 2, 10) |
| | | hot_block_score.append(high_score) |
| | | # 板块 - 板块历史出现次数 |
| | | if hot_block["target_block_info"][2] <= 1: |
| | | hot_block_score.append(10) |
| | | else: |
| | | hot_block_score.append(max(-3 * hot_block["target_block_info"][2] + 20, -10)) |
| | | if hot_block["target_block_info"][0] == "无板块": |
| | | hot_block_score.append(5) |
| | | else: |
| | | hot_block_score.append(min(int(round(__average_rate * 2 - 10)), 10)) |
| | | |
| | | # 板块 - 涨停只数 |
| | | #--先注释设置为0 |
| | | # if hot_block["limit_up_codes_count"] <= 1: |
| | | # hot_block_score.append(1) |
| | | # else: |
| | | # hot_block_score.append(max(12 - hot_block["limit_up_codes_count"], 2)) |
| | | hot_block_score.append(0) |
| | | |
| | | |
| | | # 板块 - 板块涨幅 |
| | | # hot_block_score.append(min(int(round(hot_block["target_block_info"][1] * 2)), 10)) |
| | | #--先注释设置为0 |
| | | hot_block_score.append(0) |
| | | |
| | | |
| | | # 板块 - 第几只涨停 |
| | | if hot_block["limit_up_index"] <= 0: |
| | | hot_block_score.append(0) |
| | | else: |
| | | hot_block_score.append(max(90 - hot_block["limit_up_index"] * 10, 0)) |
| | | # 板块 - 高位板 |
| | | high_score = 0 |
| | | for high_info in hot_block["high_block_infos"]: |
| | | c_count = __get_ban_count(high_info[1]) |
| | | high_score += min(2 * c_count - 2, 10) |
| | | hot_block_score.append(high_score) |
| | | # 板块 - 板块历史出现次数 |
| | | if hot_block["target_block_info"][2] <= 1: |
| | | hot_block_score.append(10) |
| | | else: |
| | | hot_block_score.append(max(-3 * hot_block["target_block_info"][2] + 20, -10)) |
| | | |
| | | score_list.append(hot_block_score) |
| | | # --------------- 板块结束----------------- |
| | |
| | | code_nature = code_nature_analyse.CodeNatureRecordManager.get_nature(code) |
| | | source_datas.append(code_nature) |
| | | |
| | | hot_block = hot_block_data_process.get_info(code) |
| | | hot_block = block_info.get_info(code) |
| | | if hot_block is None: |
| | | hot_block = { |
| | | # 目标板块信息(板块名称,板块涨幅,历史板块出现次数) |