Administrator
2025-01-16 5c1058420012b78c7b8360d46e8fccbcfc06cbf2
L撤调整/扫入下单调整
8个文件已修改
49 ■■■■■ 已修改文件
api/outside_api_command_callback.py 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cancel_strategy/s_l_h_cancel_strategy.py 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
constant.py 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/l2_data_manager_new.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
third_data/code_plate_key_manager.py 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/buy_radical/radical_buy_data_manager.py 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/buy_radical/radical_buy_strategy.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/trade_result_manager.py 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/outside_api_command_callback.py
@@ -1350,7 +1350,8 @@
                    "radical_buy": {"price": (constant.MIN_CODE_RADICAL_BUY_PRICE, constant.MAX_CODE_RADICAL_BUY_PRICE),
                                    "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
                                    "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
                                    }}
                self.send_response({"code": 0, "data": data, "msg": f""},
                                   client_id,
@@ -1368,7 +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')
                self.send_response({"code": 0, "data": {}, "msg": f""},
                                   client_id,
                                   request_id)
cancel_strategy/s_l_h_cancel_strategy.py
@@ -577,9 +577,11 @@
                    deal_big_order_info = radical_buy_data_manager.get_total_deal_big_order_info(code,
                                                                                                 gpcode_manager.get_limit_up_price_as_num(
                                                                                                     code))
                    if deal_big_order_info[1]/deal_big_order_info[2] > 0.8:
                        # 大单成交比例达到80%,半加红
                        return constant.L_CANCEL_RATE_WITH_HALF_MUST_BUY_FOR_REDICAL_BUY, False
                    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
            if must_buy:
                if is_up:
                    return constant.L_CANCEL_RATE_UP_WITH_MUST_BUY, True
constant.py
@@ -226,3 +226,6 @@
# 是否为新版下单
IS_NEW_VERSION_PLACE_ORDER = True
# 是否因为分数忽略板块流入
IS_IGNORE_BLOCK_IN_MONEY_WITH_MARKET_STRONG = 0
l2/l2_data_manager_new.py
@@ -1889,7 +1889,7 @@
            big_order_deal_enough_result = radical_buy_data_manager.is_big_order_deal_enough(code,
                                                                                             code_volumn_manager.CodeVolumeManager().get_volume_rate_refer_in_5days(
                                                                                                 code),
                                                                                             refer_sell_money)
                                                                                             refer_sell_money, for_buy=True)
            # 缺乏的大单金额
            lack_money = big_order_deal_enough_result[3]
            # 如果有大单成交就不需要看大单
third_data/code_plate_key_manager.py
@@ -277,7 +277,6 @@
    def list_all_deleted_cache(self):
        return self.__deleted_kpl_forbidden_plates_cache
    def is_in_cache(self, plate):
        if self.__kpl_forbidden_plates_cache and plate in self.__kpl_forbidden_plates_cache:
            return True
@@ -495,6 +494,12 @@
        cls.__market_strong = strong
    @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:
            return True
        return False
    @classmethod
    def get_market_strong(cls):
        return cls.__market_strong
trade/buy_radical/radical_buy_data_manager.py
@@ -410,7 +410,7 @@
                big_order_deal_enough = is_big_order_deal_enough(code, volume_rate, 0)
            if not big_order_deal_enough[0] and big_order_deal_enough[2]:
                return False, "交易前两分钟大单不足", False
        if not RealTimeKplMarketData.is_ignore_block_in_money():
        jx_out_blocks = RealTimeKplMarketData.get_top_market_jingxuan_out_blocks()
        if jx_out_blocks:
            blocks = RadicalBuyBlockManager.get_code_blocks(code)[0]
@@ -1128,6 +1128,8 @@
        @param is_for_buy: 是否是买入
        @return:板块是否可买, 是否需要大单够
        """
        if RealTimeKplMarketData.is_ignore_block_in_money():
            return True, False
        jx_in_blocks = RealTimeKplMarketData.get_top_market_jingxuan_blocks()
        if jx_in_blocks and block in jx_in_blocks:
            return True, False
@@ -1398,7 +1400,7 @@
    return total_lack_money, deal_big_order_money, TOTAL_BIG_DEAL_MONEY_THRESHOLD_MONEY
def is_big_order_deal_enough(code, volume_rate, refer_total_sell_money):
def is_big_order_deal_enough(code, volume_rate, refer_total_sell_money, for_buy=False):
    """
    大单成交是否足够
    @param refer_total_sell_money: 引用的总卖额
@@ -1428,7 +1430,8 @@
    # ==========判断总大单成交================
    total_lack_money_info = get_total_deal_big_order_info(code, limit_up_price)
    total_lack_money = total_lack_money_info[0]
    total_lack_money, total_deal_money, total_threshold_money = total_lack_money_info[0], total_lack_money_info[1], \
                                                                total_lack_money_info[2]
    # ===========判断单次大单成交==============
    current_big_order_deal_money = 0
    current_big_order_deal_money_info = EveryLimitupBigDealOrderManager.get_big_buy_deal_order_money_info(code)
@@ -1439,7 +1442,11 @@
        else:
            current_big_order_deal_money = current_big_order_deal_money_info[0]
    current_lack_money = max(0, int(current_threshold_money - current_big_order_deal_money))
    if total_lack_money == 0 and current_lack_money == 0:
    if for_buy:
        total_lack_money = int(total_threshold_money * 0.8 - total_deal_money)
        if total_lack_money < 0:
            total_lack_money = 0
    if current_lack_money == 0 and total_lack_money == 0:
        return True, f"量比-{volume_rate}, 瞬时大单成交-({current_big_order_deal_money}/{current_threshold_money}),总大单成交-({total_lack_money_info[1]}/{total_lack_money_info[2]})", before_time, 0
    return False, f"量比-{volume_rate}, 瞬时大单成交-({current_big_order_deal_money}/{current_threshold_money}),总大单成交-({total_lack_money_info[1]}/{total_lack_money_info[2]})", before_time, max(
        current_lack_money, total_lack_money)
trade/buy_radical/radical_buy_strategy.py
@@ -162,7 +162,7 @@
    if rate >= THRESHOLD_RATE:
        # 根据大单判断是否可以扫
        big_order_deal_result = radical_buy_data_manager.is_big_order_deal_enough(code, volume_rate,
                                                                                  refer_sell_money)
                                                                                  refer_sell_money, for_buy=True)
        if big_order_deal_result[0]:
            return BUY_MODE_DIRECT, f"剩余涨停总卖额-{selling_num * price},原涨停总卖-{total_sell},已成交额-{__deal_active_buy_total_money[code]},成交比例-{rate}/{THRESHOLD_RATE}, 大单信息-{big_order_deal_result}"
        else:
trade/trade_result_manager.py
@@ -105,9 +105,9 @@
        MustBuyCodesManager().remove_code(code)
    # 如果是绿名单,下单之后就加红
    if GreenListCodeManager().is_in_cache(code):
        MustBuyCodesManager().add_code(code)
        trade_record_log_util.add_must_buy(code, "如果是绿名单,下单之后就加红")
    # if GreenListCodeManager().is_in_cache(code):
    #     MustBuyCodesManager().add_code(code)
    #     trade_record_log_util.add_must_buy(code, "如果是绿名单,下单之后就加红")
    # 如果是扫入下单,下单之后就加红
    if order_begin_pos.mode == OrderBeginPosInfo.MODE_RADICAL: