Administrator
2025-01-16 7a25ab250084c544d58c3c8dedc55dfd62241e1c
L后撤修改/不看板块流入优化
4个文件已修改
48 ■■■■ 已修改文件
api/outside_api_command_callback.py 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cancel_strategy/s_l_h_cancel_strategy.py 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
constant.py 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
third_data/code_plate_key_manager.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/outside_api_command_callback.py
@@ -1351,7 +1351,7 @@
                                    "zyltgb": constant.RADICAL_BUY_ZYLTGB_AS_YI_RANGES,
                                    "top_block_count_by_market_strong": constant.RADICAL_BUY_TOP_IN_COUNT_BY_MARKET_STRONG,
                                    "special_codes_max_block_in_rank": constant.RADICAL_BUY_TOP_IN_INDEX_WITH_SPECIAL,
                                    "ignore_block_in_money":constant.IS_IGNORE_BLOCK_IN_MONEY_WITH_MARKET_STRONG
                                    "ignore_block_in_money_market_strong":constant.IGNORE_BLOCK_IN_MONEY_MARKET_STRONG
                                    }}
                self.send_response({"code": 0, "data": data, "msg": f""},
                                   client_id,
@@ -1369,8 +1369,8 @@
                    if radical_buy.get("special_codes_max_block_in_rank"):
                        constant.RADICAL_BUY_TOP_IN_INDEX_WITH_SPECIAL = radical_buy.get(
                            "special_codes_max_block_in_rank")
                    if radical_buy.get('ignore_block_in_money') is not None:
                        constant.IS_IGNORE_BLOCK_IN_MONEY_WITH_MARKET_STRONG = radical_buy.get('ignore_block_in_money')
                    if radical_buy.get('ignore_block_in_money_market_strong') is not None:
                        constant.IGNORE_BLOCK_IN_MONEY_MARKET_STRONG = radical_buy.get('ignore_block_in_money_market_strong')
                self.send_response({"code": 0, "data": {}, "msg": f""},
                                   client_id,
                                   request_id)
cancel_strategy/s_l_h_cancel_strategy.py
@@ -566,7 +566,7 @@
    # 获取撤单比例,返回(撤单比例,是否必买)
    @classmethod
    def get_cancel_rate(cls, code, buy_exec_time, is_up=False, is_l_down_recomputed=False, buy_mode = None):
    def get_cancel_rate(cls, code, buy_exec_time, is_up=False, is_l_down_recomputed=False, buy_mode=None):
        try:
            must_buy = cls.__MustBuyCodesManager.is_in_cache(code)
            if buy_mode == OrderBeginPosInfo.MODE_RADICAL:
@@ -577,8 +577,8 @@
                    deal_big_order_info = radical_buy_data_manager.get_total_deal_big_order_info(code,
                                                                                                 gpcode_manager.get_limit_up_price_as_num(
                                                                                                     code))
                    deal_rate = round(deal_big_order_info[1]/deal_big_order_info[2], 2)
                    threshold_rate = 0.5*deal_rate+0.35
                    deal_rate = round(deal_big_order_info[1] / deal_big_order_info[2], 2)
                    threshold_rate = 0.5 * deal_rate + 0.35
                    threshold_rate = max(threshold_rate, 0.375)
                    threshold_rate = min(threshold_rate, 0.95)
                    return threshold_rate, False
@@ -980,8 +980,10 @@
                    ##判断监听的数据中是否有大单##
                    # 之前的大单为100w,现在改为正常大单
                    has_big_num = False
                    BIG_ORDER_NUM_THRESHOLD = l2_data_util.get_big_money_val(gpcode_manager.get_limit_up_price_as_num(code), tool.is_ge_code(code))
                    BIG_ORDER_NUM_THRESHOLD = int(round(BIG_ORDER_NUM_THRESHOLD/(gpcode_manager.get_limit_up_price_as_num(code)*100)))
                    BIG_ORDER_NUM_THRESHOLD = l2_data_util.get_big_money_val(
                        gpcode_manager.get_limit_up_price_as_num(code), tool.is_ge_code(code))
                    BIG_ORDER_NUM_THRESHOLD = int(
                        round(BIG_ORDER_NUM_THRESHOLD / (gpcode_manager.get_limit_up_price_as_num(code) * 100)))
                    for i in watch_indexes:
                        # 是否有大单
                        data = total_datas[i]
@@ -1014,6 +1016,28 @@
                                                                                           cancel_data['val'])) <= 0:
                                watch_indexes.add(i)
                                break
                    # 计算真实下单位置到成交进度位的最大未撤大单前2
                    big_order_list = []
                    for i in range(start_index, end_index):
                        data = total_datas[i]
                        val = data['val']
                        # 涨停买,且未撤单
                        if not L2DataUtil.is_limit_up_price_buy(val):
                            continue
                        # 小金额过滤
                        if val['num'] < BIG_ORDER_NUM_THRESHOLD:
                            continue
                        cancel_data = l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_canceled_data_v2(code,
                                                                                                              i,
                                                                                                              total_datas,
                                                                                                              local_today_canceled_buyno_map.get(
                                                                                                                  code))
                        if not cancel_data:
                            big_order_list.append((i, val['num']))
                    if big_order_list:
                        big_order_list.sort(key=lambda x: x[1], reverse=True)
                        watch_indexes |= set([x[0] for x in big_order_list[:2]])
                    # 获取真实下单位后面10笔大单
                    watch_indexes_after = self.__compute_l_down_watch_index_after_real_place_order_index(code)
                    if watch_indexes_after:
constant.py
@@ -227,5 +227,7 @@
# 是否为新版下单
IS_NEW_VERSION_PLACE_ORDER = True
# 是否因为分数忽略板块流入
IS_IGNORE_BLOCK_IN_MONEY_WITH_MARKET_STRONG = 0
# 忽略板块流入的市场强度
IGNORE_BLOCK_IN_MONEY_MARKET_STRONG = 101
third_data/code_plate_key_manager.py
@@ -495,7 +495,7 @@
    @classmethod
    def is_ignore_block_in_money(cls):
        if constant.IS_IGNORE_BLOCK_IN_MONEY_WITH_MARKET_STRONG and cls.__market_strong and cls.__market_strong >= 80:
        if cls.__market_strong and cls.__market_strong >= constant.IGNORE_BLOCK_IN_MONEY_MARKET_STRONG:
            return True
        return False