Administrator
2024-05-09 464b9069e5b729d07004fc703ae5b86091d6d66e
激进下单修改/j撤修复
3个文件已修改
21 ■■■■■ 已修改文件
l2/cancel_buy_strategy.py 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/l2_data_manager_new.py 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin/huaxin_trade_server.py 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/cancel_buy_strategy.py
@@ -3233,6 +3233,9 @@
        # 计算剩余数量
        total_datas = local_today_datas.get(code)
        if int(total_datas[end_index]['val']['time'].replace(":","")) > 145000:
            return False, None, "超过生效时间"
        buyno_map = local_today_buyno_map.get(code)
        limit_up_price = round(float(gpcode_manager.get_limit_up_price(code)), 2)
        min_volume = 50 * 10000 // int(limit_up_price * 100)
l2/l2_data_manager_new.py
@@ -606,14 +606,14 @@
        # J撤
        def j_cancel(_buy_single_index, _buy_exec_index):
            try:
                b_need_cancel, b_cancel_data, extra_msg = JCancelBigNumComputer().need_cancel(code, start_index, end_index)
                b_need_cancel, b_cancel_data, extra_msg = JCancelBigNumComputer().need_cancel(code, start_index,
                                                                                              end_index)
                if b_need_cancel and b_cancel_data:
                    return b_cancel_data, f"J撤({extra_msg})"
            except Exception as e:
                async_log_util.error(logger_l2_error,
                                     f"J撤出错 参数:buy_single_index-{_buy_single_index} buy_exec_index-{_buy_exec_index} 错误原因:{str(e)}")
            return None, ""
        if start_index < 0:
            start_index = 0
@@ -663,13 +663,16 @@
        @param code:
        @return:
        """
        if global_util.zyltgb_map.get(code) > 50 * 100000000:
            # 50亿以上的无法激进下单
            return None
        can_buy_result = CodePlateKeyBuyManager.can_buy(code)
        if can_buy_result:
            if can_buy_result[5]:
                return can_buy_result[5]
            elif not can_buy_result[0] and can_buy_result[1]:
                # 10:00:00 前的独苗可激进买入
                if tool.trade_time_sub(tool.get_now_time_str(),"10:00:00") <=0:
                if tool.trade_time_sub(tool.get_now_time_str(), "10:00:00") <= 0:
                    return ["独苗"]
        return None
@@ -1274,7 +1277,6 @@
        # 是否是强势30分钟
        is_in_strong_time_30 = now_timestamp <= int("100000")
        # 获取市场行情
        situation = cls.__MarketSituationManager.get_situation_cache()
trade/huaxin/huaxin_trade_server.py
@@ -64,7 +64,8 @@
from trade.sell.sell_rule_manager import TradeRuleManager, SellRule
from trade.trade_manager import TradeTargetCodeModeManager, MarketSituationManager, AutoCancelSellModeManager, \
    CodesTradeStateManager
from utils import socket_util, data_export_util, middle_api_protocol, tool, huaxin_util, output_util, sell_util
from utils import socket_util, data_export_util, middle_api_protocol, tool, huaxin_util, output_util, sell_util, \
    global_util
trade_data_request_queue = queue.Queue()
@@ -1739,8 +1740,9 @@
            if _type == L2TradeSingleDataManager.TYPE_PASSIVE and mode_descs:
                # 可以激进下单且必须是首次下单才能激进
                place_order_count = trade_data_manager.PlaceOrderCountManager().get_place_order_count(code)
                if place_order_count == 0:
                if place_order_count == 0 and current_total_sell_data[1] > 500*10000 and global_util.zyltgb_map.get(code) < 50 * 100000000:
                    # 首次下单,自由流通50亿以下,总卖额500w才能激进下单
                    mode_descs.insert(0, "成交触发")
                    last_index = total_datas[-1]["index"]
                    volume_rate = code_volumn_manager.get_volume_rate(code)
@@ -1761,7 +1763,7 @@
                    l2_data_manager_new.L2TradeDataProcessor.start_buy(code, total_datas[-1], total_datas[-1]["index"],
                                                                       True)
                else:
                    l2_log.debug(code, "激进下单,但不是首次下单,无法激进")
                    l2_log.debug(code, "激进下单,不满足激进下单条件,无法激进")
            else:
                if code.find("00") != 0:
                    return