From 3ec79004bd769828c8dc18ed35280f81cfb473ff Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期三, 08 二月 2023 19:30:45 +0800 Subject: [PATCH] 交易结果整理 --- l2/l2_data_util.py | 27 +++++++++++++++++++++++---- 1 files changed, 23 insertions(+), 4 deletions(-) diff --git a/l2/l2_data_util.py b/l2/l2_data_util.py index bac68e1..6424957 100644 --- a/l2/l2_data_util.py +++ b/l2/l2_data_util.py @@ -11,7 +11,7 @@ import constant import gpcode_manager -import l2_data_log +from l2 import l2_data_log import log from db import redis_manager import tool @@ -170,6 +170,23 @@ datas = L2DataUtil.format_l2_data(data, code, limit_up_price) # 鑾峰彇娑ㄥ仠浠� return day, client, channel, code, capture_time, process_time, datas, data + + +# 鏄惁涓哄ぇ鍗� +def is_big_money(val): + price = float(val["price"]) + money = price * int(val["num"]) + if price > 3.0: + if money >= 30000: + return True + else: + return False + else: + max_money = price * 10000 + if money >= max_money * 0.95: + return True + else: + return False class L2DataUtil: @@ -363,7 +380,7 @@ class L2TradeQueueUtils(object): # 鑾峰彇鎴愪氦杩涘害绱㈠紩 @classmethod - def find_traded_progress_index(cls, buy_1_price, total_datas, local_today_num_operate_map, queueList, + def find_traded_progress_index(cls, buy_1_price, total_datas, local_today_num_operate_map, queueList,last_index, latest_not_limit_up_time=None): if len(queueList) == 0: return None @@ -380,7 +397,8 @@ # 鍦ㄦ渶杩戜竴娆¢潪娑ㄥ仠涔�1鏇存柊鐨勬椂闂翠箣鍚庢墠鏈夋晥 if latest_not_limit_up_time is None or tool.trade_time_sub(data["val"]["time"], latest_not_limit_up_time) >= 0: - index_set.add(data["index"]) + if data["index"]>=last_index: + index_set.add(data["index"]) index_list = list(index_set) index_list.sort() num_list = [] @@ -396,7 +414,8 @@ temp_str = index_list_str[0:find_index] if temp_str.endswith(","): temp_str = temp_str[:-1] - + if temp_str == "": + return new_index_list[0] return new_index_list[len(temp_str.split(","))] raise Exception("灏氭湭鎵惧埌鎴愪氦杩涘害") -- Gitblit v1.8.0