| | |
| | | |
| | | # 是否具有辨识度 |
| | | def is_special(datas): |
| | | # 30个交易日内有≥5天曾涨停且连续涨停数或曾涨停≥2天 |
| | | if len(datas) > 30: |
| | | datas = datas[-30:] |
| | | datas = copy.deepcopy(datas) |
| | | datas.sort(key=lambda x: x["bob"]) |
| | | datas_30 = datas[-30:] |
| | | datas_90 = datas[-90:] |
| | | count = 0 |
| | | # 30个交易日内累计涨停次数≥4次 |
| | | continue_count = 0 |
| | | has_continue = False |
| | | for item in datas_30: |
| | | if __is_limit_up(item): |
| | | continue_count += 1 |
| | | count += 1 |
| | | if continue_count >= 4: |
| | | has_continue = True |
| | | else: |
| | | continue_count = 0 |
| | | if count >= 5 and has_continue: |
| | | return True, "短期辨识度" |
| | | |
| | | count = 0 |
| | | continue_count = 0 |
| | | last_index = -1 |
| | | for i in range(len(datas)): |
| | | if __is_limited_up(datas[i]): |
| | | if last_index >= 0 and i - last_index == 1: |
| | | continue_count += 1 |
| | | has_continue = False |
| | | # 90个交易日内涨停次数≥6次 |
| | | for item in datas_90: |
| | | if __is_limit_up(item): |
| | | continue_count += 1 |
| | | count += 1 |
| | | last_index = i |
| | | if count >= 5 and continue_count > 0: |
| | | return True, '' |
| | | return False, '' |
| | | if continue_count >= 4: |
| | | has_continue = True |
| | | else: |
| | | continue_count = 0 |
| | | if count >= 7 and has_continue: |
| | | return True, "长期辨识度" |
| | | return False, "" |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | |
| | | return False, True, f"参考量在最近5天,量未达到60%({cls.volume_rate_info[code][0]})" |
| | | |
| | | zyltgb = global_util.zyltgb_map.get(code) |
| | | if k_format and k_format[8][0]: |
| | | # 具有辨识度 |
| | | zyltgb = 15 * 100000000 |
| | | |
| | | if zyltgb >= 40 * 100000000: |
| | | return False, True, f"40亿以上的都不买({zyltgb})" |
| | | |
| | |
| | | |
| | | if __name__ == "__main__": |
| | | # code_str = "002103,002108,002176,002189,002328,002397,002457,002495,002578,002903,002933,003028,003040,600234,600293,600764,603090,603162,603193,603270,603332,603380,603615,603711" |
| | | code_str = "002933" |
| | | code_str = "000656,000779,000892,000995,001255,001269,001300,002103,002127,002292,002306,002323,002494,002518,002613,002615,002697,002748,002771,002799,002855,002875,002878,002931,002942,300530,301168,600159,600321,600630,600805,603188,603392,603600,603608,603628,603729,603836,605117,688685" |
| | | codes = code_str.split(",") |
| | | for code in codes: |
| | | if not tool.is_shsz_code(code): |
| | |
| | | try: |
| | | # limit_up_price = 16.96 |
| | | volumes_data = init_data_util.get_volumns_by_code(code, 150) |
| | | # volumes_data = volumes_data[1:] |
| | | print(code, is_too_high(volumes_data)) |
| | | volumes_data = volumes_data[4:] |
| | | print(code, code_nature_analyse.is_special(volumes_data)) |
| | | except: |
| | | print(code, "出错") |
| | |
| | | import time |
| | | |
| | | import constant |
| | | from code_attribute import code_nature_analyse |
| | | from db.redis_manager_delegate import RedisUtils |
| | | from third_data import kpl_block_util, kpl_api, kpl_util |
| | | from utils import global_util, tool |
| | |
| | | if current_shsz_rank < len(current_open_limit_up_codes) + max_rank: |
| | | return True, False, f"【{block}】前排代码:{current_shsz_rank}", is_strong_block |
| | | else: |
| | | k_format = code_nature_analyse.CodeNatureRecordManager().get_k_format_cache(code) |
| | | if k_format and k_format[8][0]: |
| | | # 具有辨识度 |
| | | return True, False, f"【{block}】具有辨识度", is_strong_block |
| | | # 看自由流通市值是否小于20亿 |
| | | if is_strong_block and current_shsz_rank < len(current_open_limit_up_codes) + max_rank + 1: |
| | | zyltgb = global_util.zyltgb_map.get(code) |
| | |
| | | return json.dumps(result) |
| | | return None |
| | | |
| | | |
| | | def getHistoryLimitUpInfo(day): |
| | | data = f"Order=1&a=HisDaBanList&st=19&c=HisHomeDingPan&PhoneOSNew=1&DeviceID=a38adabd-99ef-3116-8bb9-6d893c846e23&VerSion=5.8.0.2&Index=0&Is_st=1&PidType=1&apiv=w32&Type=6&FilterMotherboard=0&Filter=0&FilterTIB=0&Day={day}&FilterGem=0&" |
| | | result = __base_request("https://apphis.longhuvip.com/w1/api/index.php", data=data) |
| | | fresults = [] |
| | | for i in range(0, 5): |
| | | data = f"Order=1&a=HisDaBanList&st=20&c=HisHomeDingPan&PhoneOSNew=1&DeviceID=a38adabd-99ef-3116-8bb9-6d893c846e23&VerSion=5.8.0.2&Index={i * 20}&Is_st=1&PidType=1&apiv=w32&Type=6&FilterMotherboard=0&Filter=0&FilterTIB=0&Day={day}&FilterGem=0&" |
| | | result = __base_request("https://apphis.longhuvip.com/w1/api/index.php", data=data) |
| | | result = json.loads(result) |
| | | result = result["list"] |
| | | fresults.extend(result) |
| | | if len(result) < 20: |
| | | break |
| | | return fresults |
| | | |
| | | |
| | | # 市场行情-行业 |
| | |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | codes = "000422,000536,000619,000766,000892,001255,001258,001300,002288,002442,002584,002632,002771,002942,300505,300949,600293,600610,600679,600769,603168,603188,603291,603329,603392,603518,603759,603767,603836,603839,603938,605218,688655" |
| | | codes = codes.split(",") |
| | | for code in codes: |
| | | print(code, getCodeReductionDate(code)) |
| | | results = getHistoryLimitUpInfo("2023-12-26") |
| | | print(results) |