| | |
| | | yi = round(zyltgb / 100000000) |
| | | if yi < 1: |
| | | yi = 1 |
| | | return 5000000 + (yi - 1) * 500000 |
| | | m = 5000000 + (yi - 1) * 500000 |
| | | return round(m * 0.7) |
| | | |
| | | # 获取行业影响比例 |
| | | # total_limit_percent为统计的比例之和乘以100 |
| | | @classmethod |
| | | def get_industry_rate(cls, total_limit_percent): |
| | | if total_limit_percent is None: |
| | | return 0 |
| | | t = total_limit_percent / 10 |
| | | if t < 0.9: |
| | | return 0 |
| | |
| | | return 0.2 |
| | | elif t <= 1.6: |
| | | return 0 |
| | | elif t <= 2.1: |
| | | return 0.03 |
| | | elif t <= 2.6: |
| | | return 0.06 |
| | | elif t <= 3.1: |
| | | return 0.09 |
| | | elif t <= 3.6: |
| | | return 0.12 |
| | | elif t <= 4.1: |
| | | return 0.15 |
| | | elif t <= 4.6: |
| | | return 0.18 |
| | | elif t <= 5.1: |
| | | return 0.21 |
| | | elif t <= 5.6: |
| | | return 0.24 |
| | | elif t <= 6.1: |
| | | return 0.27 |
| | | else: |
| | | return 0.30 |
| | | rate = 0 |
| | | for i in range(0, 30): |
| | | if t <= 2.1 + 0.5 * i: |
| | | rate = 0.03 * (i + 1) |
| | | break |
| | | if rate > 0.9: |
| | | rate = 0.9 |
| | | return rate |
| | | |
| | | # 获取量影响比例 |
| | | @classmethod |
| | |
| | | factors = cls.__get_rate_factors(code) |
| | | return cls.compute_rate(factors[0], factors[1], factors[2], factors[3], factors[4], factors[5], factors[6]) |
| | | |
| | | # 获取代码当前所在的行业热度 |
| | | @classmethod |
| | | def __get_rate_factors(cls, code): |
| | | zyltgb = global_util.zyltgb_map.get(code) |
| | | def __get_industry_limit_percent(cls, code): |
| | | # 获取行业热度 |
| | | industry = global_util.code_industry_map.get(code) |
| | | if industry is None: |
| | |
| | | |
| | | total_industry_limit_percent = global_util.industry_hot_num.get(industry) if industry is not None else None |
| | | # 当前票是否涨停 |
| | | if total_industry_limit_percent is not None: |
| | | if code in global_util.limit_up_codes_percent: |
| | | total_industry_limit_percent -= global_util.limit_up_codes_percent[code] |
| | | # if total_industry_limit_percent is not None: |
| | | # if code in global_util.limit_up_codes_percent: |
| | | # # 减去当前票的涨幅 |
| | | # total_industry_limit_percent -= global_util.limit_up_codes_percent[code] |
| | | return total_industry_limit_percent |
| | | |
| | | @classmethod |
| | | def __get_rate_factors(cls, code): |
| | | zyltgb = global_util.zyltgb_map.get(code) |
| | | total_industry_limit_percent = cls.__get_industry_limit_percent(code) |
| | | # 获取量 |
| | | volumn_day60_max, volumn_yest, volumn_today = global_util.max60_volumn.get( |
| | | code), global_util.yesterday_volumn.get(code), global_util.today_volumn.get(code) |
| | |
| | | return 8 |
| | | count = gb // 100000000 |
| | | if count > 30: |
| | | return 30 |
| | | count = 30 |
| | | if count < 5: |
| | | return 5 |
| | | count = 5 |
| | | |
| | | big_money_num = global_util.big_money_num.get(code) |
| | | if big_money_num is None: |
| | |
| | | if big_money_num is not None: |
| | | rate = cls.get_big_money_rate(big_money_num) |
| | | |
| | | return round(count*(1-rate/2)) |
| | | # 获取行业热度对应的比例 |
| | | total_industry_limit_percent = cls.__get_industry_limit_percent(code) |
| | | industry_rate = cls.get_industry_rate(total_industry_limit_percent) |
| | | # 取大单影响值与行业影响值的较大值 |
| | | return round(count * (1 - max(rate, industry_rate))) |
| | | |
| | | |
| | | # l2因子归因数据 |