Administrator
2023-02-08 3ec79004bd769828c8dc18ed35280f81cfb473ff
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("尚未找到成交进度")