From ddd49deef7ac6daff95086f112a0061a641c4fe3 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期四, 13 六月 2024 15:36:00 +0800 Subject: [PATCH] 添加订阅日志 --- test/test_code_attribute.py | 62 +++++++++++++++++++++--------- 1 files changed, 43 insertions(+), 19 deletions(-) diff --git a/test/test_code_attribute.py b/test/test_code_attribute.py index 32cbd94..94cce59 100644 --- a/test/test_code_attribute.py +++ b/test/test_code_attribute.py @@ -1,25 +1,49 @@ from code_attribute import code_nature_analyse -from utils import init_data_util +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_price_too_high_in_days(datas, limit_up_price) - 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 = "600053" + limit_up_price = 14.91 + volumes_data = init_data_util.get_volumns_by_code(code, 150) + volumes_data = volumes_data[1:] + volumes = init_data_util.parse_max_volume(code, volumes_data[:90], + code_nature_analyse.is_new_top(code, + limit_up_price, + volumes_data[ + :90]) or code_nature_analyse.is_near_top( + code, + limit_up_price, + volumes_data[:90])) + print(volumes) if __name__ == "__main__": - code_str = "000536,000625,000628,000670,000766,000829,001311,001331,002189,002275,002331,002341,002363,002406,002416,002655,002691,002848,002861,002885,002906,002917,002962,300217,300462,300552,301111,301215,301372,600107,600178,600222,600288,600513,600698,600960,601777,603029,603286,603297,603569,605020,688314,688789" - codes = code_str.split(",") - for code in codes: - if code.find("00") != 0 and code.find("60") != 0: - continue - try: - datas = init_data_util.get_volumns_by_code(code, 120) - datas = datas[3:] - result = is_too_high(datas) - if result: - print(code, result) - except: - print(code, "鍑洪敊") + code = "301176" + volumes_data = init_data_util.get_volumns_by_code(code, 150) + print(len(volumes_data)) + # 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)) -- Gitblit v1.8.0