From 90c2a0a0f5690381e3b286d6ca1fd0c6f63acab1 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期三, 21 二月 2024 17:50:03 +0800 Subject: [PATCH] 6天长得过高/L2不过滤1手的数据/处理L2数据时间与本地时间相差过大的问题 --- test/test_code_attribute.py | 25 +++++++++++++++++++------ 1 files changed, 19 insertions(+), 6 deletions(-) diff --git a/test/test_code_attribute.py b/test/test_code_attribute.py index d1a59b8..d01f83b 100644 --- a/test/test_code_attribute.py +++ b/test/test_code_attribute.py @@ -2,11 +2,24 @@ 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_from_latest_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(): @@ -24,7 +37,7 @@ if __name__ == "__main__": - __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:] -- Gitblit v1.8.0