| | |
| | | from code_attribute import code_nature_analyse |
| | | from code_attribute import code_nature_analyse, code_volumn_manager |
| | | from utils import init_data_util, tool |
| | | |
| | | |
| | | def is_too_high(datas): |
| | | limit_up_price = round(datas[0]["close"] * 1.1, 2) |
| | | datas.reverse() |
| | | is_new_high = code_nature_analyse.is_up_too_high_in_10d_with_limit_up(datas) |
| | | return is_new_high |
| | | def is_too_high(): |
| | | codes_str = "000001,000099,000151,000514,000565,000572,000608,000622,000626,000678,000679,000691,000702,000757,000820,000836,000838,000929,000957,000982,001300,001317,001387,002072,002098,002141,002161,002173,002192,002207,002211,002217,002298,002308,002312,002494,002496,002513,002529,002530,002571,002575,002591,002620,002622,002633,002652,002661,002691,002775,002789,002798,002811,002813,002822,002842,002853,002856,002862,002952,002997,003011,003015,300032,300117,300152,300157,300380,300530,300635,300780,300921,300935,301068,301072,301107,301508,600083,600099,600107,600132,600148,600149,600165,600172,600178,600192,600199,600241,600266,600281,600302,600321,600421,600444,600449,600561,600565,600678,600696,600702,600847,601068,601236,601689,603011,603021,603023,603040,603048,603090,603109,603111,603121,603135,603178,603269,603272,603286,603316,603326,603335,603345,603360,603377,603378,603388,603389,603655,603709,603755,603776,603801,603828,603838,603843,603879,603898,603917,603978,605001,605069,605100,605117,605378" |
| | | codes = codes_str.split(",") |
| | | codes.reverse() |
| | | fresults = [] |
| | | for code in codes: |
| | | try: |
| | | volumes_data = init_data_util.get_volumns_by_code(code, 150) |
| | | limit_up_price = round(volumes_data[0]["close"] * 1.1, 2) |
| | | print(code) |
| | | is_too_high, rate = code_nature_analyse.is_price_too_high_in_days(volumes_data, limit_up_price) |
| | | # print(code, is_too_high) |
| | | fresults.append((code, rate)) |
| | | except: |
| | | pass |
| | | fresults.sort(key=lambda x: x[1], reverse=True) |
| | | for f in fresults: |
| | | print(f) |
| | | |
| | | |
| | | def __get_refer_volume_info(): |
| | | code = "301511" |
| | | limit_up_price = 4.82 |
| | | volumes_data = init_data_util.get_volumns_by_code(code, 150) |
| | | # volumes_data = volumes_data[1:] |
| | | volumes = init_data_util.parse_max_volume_new(code, volumes_data[:90]) |
| | | max_volume_in_5_days = init_data_util.parse_max_volume_in_days(volumes_data, 5) |
| | | |
| | | code_volumn_manager.CodeVolumeManager().set_histry_volumn(code, volumes[0], volumes[1], volumes[2], volumes[3], |
| | | max_volume_in_5_days) |
| | | print(volumes) |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | code_str = "600748" |
| | | codes = code_str.split(",") |
| | | for code in codes: |
| | | if not tool.is_shsz_code(code): |
| | | continue |
| | | try: |
| | | datas = init_data_util.get_volumns_by_code(code, 120) |
| | | result = code_nature_analyse.__is_yesterday_open_limit_up(datas) |
| | | if result: |
| | | print(code, result) |
| | | except: |
| | | print(code, "出错") |
| | | __get_refer_volume_info() |
| | | # is_too_high() |
| | | # code = "601022" |
| | | # volumes_data = init_data_util.get_volumns_by_code(code, 150) |
| | | # volumes_data = volumes_data[0:] |
| | | # print( code_nature_analyse.is_special(volumes_data)) |