Administrator
2024-01-16 1128f9b16dbf6d3ff8083cb2a6a5a860c1ada57d
G撤修改
3个文件已修改
35 ■■■■ 已修改文件
l2/cancel_buy_strategy.py 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2_data_util.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
log_module/log_export.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/cancel_buy_strategy.py
@@ -1568,7 +1568,7 @@
        if transaction_data[2] < 10000:
            return False, "成交量小于10000"
        # 成交100万以上才算
        if transaction_data[1]*transaction_data[2] < 1000000:
        if transaction_data[1] * transaction_data[2] < 1000000:
            return False, "金额不满足要求"
        code = transaction_data[0]
        real_order_index = self.__real_order_index_cache.get(code)
@@ -1683,7 +1683,7 @@
                final_watch_indexes = origin_watch_index | watch_indexes
                self.__watch_indexes_dict[code] = final_watch_indexes
        else:
            l2_log.g_cancel_debug(code,f"没有大单监听,开始计算小单:{start_index}-{real_order_index}")
            l2_log.g_cancel_debug(code, f"没有大单监听,开始计算小单:{start_index}-{real_order_index}")
            # 没有300万以上的大单了,计算备用
            # 只有备用单成交了或者没有备用单,才会再次寻找备用单
            need_find_by = False
@@ -1736,7 +1736,7 @@
        watch_indexes_by = self.__watch_indexes_by_dict.get(code)
        if watch_indexes_by is None:
            watch_indexes_by = set()
        need_compute = False
        for i in range(start_index, end_index + 1):
            data = total_datas[i]
            val = data["val"]
@@ -1749,7 +1749,28 @@
                                                                                                    code))
            if buy_index is not None and buy_index < real_place_order_index and (
                    buy_index in watch_indexes or buy_index in watch_indexes_by):
                return True, data, ""
                if buy_index in watch_indexes_by:
                    # 备用撤单,直接撤
                    return True, data, ""
                elif buy_index in watch_indexes:
                    # 大单撤需要重新计算大单撤单比例
                    need_compute = True
                    break
        if need_compute:
            canceled_indexes = set()
            for index in watch_indexes:
                cancel_data = l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_canceled_data_v2(code, index,
                                                                                                      total_datas,
                                                                                                      local_today_canceled_buyno_map.get(
                                                                                                          code))
                if cancel_data:
                    canceled_indexes.add(cancel_data["index"])
            cancel_rate = len(canceled_indexes) / len(watch_indexes)
            if cancel_rate > 0.2:
                canceled_indexes_list = list(canceled_indexes)
                canceled_indexes_list.sort()
                return True, total_datas[canceled_indexes_list[-1]], f"撤单比例:{cancel_rate}"
        return False, None, ""
    def place_order_success(self, code):
l2_data_util.py
@@ -32,7 +32,7 @@
    price = float(val["price"])
    money = price * val["num"]
    if price > 3.0:
        if money >= 30000:
        if money >= 29900:
            return True
        else:
            return False
@@ -47,7 +47,7 @@
# 获取大资金的金额
def get_big_money_val(limit_up_price):
    if limit_up_price > 3.0:
        return 300 * 10000
        return 299 * 10000
    else:
        max_money = limit_up_price * 10000
        return max_money * 0.95
log_module/log_export.py
@@ -192,7 +192,7 @@
            if line.find("真实下单位置") > 0:
                str_ = line.split("真实下单位置:")[1].strip()
                pos = int(str_.split("-")[1].strip())
                pos = int(eval(str_.split("-")[1].strip())[0])
                # print("信号起始位置:", index)
                pos_list.append(pos)
    return pos_list