Administrator
2024-04-26 8d9d134ef893b7dcf1e7f9112810cc1358c27d20
S快撤大单修改
3个文件已修改
27 ■■■■ 已修改文件
l2/cancel_buy_strategy.py 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
third_data/kpl_data_manager.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin/huaxin_trade_api.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/cancel_buy_strategy.py
@@ -138,6 +138,24 @@
    def place_order_success(self, code):
        self.__clear_data(code)
    def __get_fast_threshold_value(self, code):
        """
        获取S快炸的阈值
        @param code:
        @return:(大单阈值, 800w内大单阈值)
        """
        max60, yesterday = code_volumn_manager.get_histry_volumn(code)
        if max60:
            num = max60[0]
            limit_up_price = gpcode_manager.get_limit_up_price(code)
            if limit_up_price:
                money_y = min(round((num * float(limit_up_price)) / 1e8, 1), 7.9)
                money = int(round(15 * money_y + 276.5))
                money_800 = int(round(money * 0.668))
                return money, money_800
        # 默认值
        return 299, 200
    # S前撤实现
    def __need_cancel_for_up(self, code, big_sell_order_info, total_datas):
        # 查询是否是真的真实下单位置
@@ -323,7 +341,7 @@
        limit_up_price = gpcode_manager.get_limit_up_price(code)
        # 判断是否为激进下单
        threash_money_w = 299
        threash_money_w, threash_money_danger_w = self.__get_fast_threshold_value(code)
        total_fast_num = 0
        try:
            # 15分钟内真实成交位距离真实下单位,金额≤800万 ,大单阈值变为200w
@@ -360,7 +378,7 @@
                            total_num += val["num"]
                            total_fast_num += val['num']
                    if total_num * float(limit_up_price) < 800 * 100:
                        threash_money_w = 200
                        threash_money_w = threash_money_danger_w
        except Exception as e:
            l2_log.s_cancel_debug(code, f"S撤激进下单计算大单卖阈值出错:{str(e)}")
        total_fast_money = int(total_fast_num * 100 * float(limit_up_price))
third_data/kpl_data_manager.py
@@ -427,6 +427,7 @@
        @return:
        """
        # 修复涨停
        logger_debug.info("任务修复-开盘啦:启动修复")
        key = "limit_up"
        if key not in cls.__latest_update_time_dict or time.time() - cls.__latest_update_time_dict[key] > 20:
            logger_debug.info("任务修复-开盘啦:涨停列表")
@@ -437,7 +438,7 @@
    def run_limit_up_task(cls):
        while True:
            try:
                if (tool.is_trade_time() and int(tool.get_now_time_str().replace(':', '')) > int("092530")):
                if (tool.is_trade_time() and int(tool.get_now_time_str().replace(':', '')) > int("092530")) or True:
                    results = kpl_api.getLimitUpInfoNew()
                    result = json.loads(results)
                    start_time = time.time()
trade/huaxin/huaxin_trade_api.py
@@ -209,7 +209,7 @@
    __create_trade_ipc_context(trade_ipc_addr)
    # 测试下单
    threading.Thread(target=lambda: __test_order(), daemon=True).start()
    # threading.Thread(target=lambda: __test_order(), daemon=True).start()
# 交易通道的错误次数