Administrator
2024-04-29 2911865221ac16300a90b8a21f84a2d0525a1e82
F撤修改/获取板块中的代码添加输出参数
2个文件已修改
20 ■■■■■ 已修改文件
l2/cancel_buy_strategy.py 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
third_data/data_server.py 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/cancel_buy_strategy.py
@@ -1729,10 +1729,11 @@
    def cancel_success(self, code):
        self.clear(code)
    def __get_fast_deal_threshold_value(self, code):
    def __get_fast_deal_threshold_value(self, code, place_order_time_str):
        """
        获取 F撤阈值
        @param code:
        @param place_order_time_str:下单时间
        @return:(金额(单位:W),笔数)
        """
        max60, yesterday = code_volumn_manager.get_histry_volumn(code)
@@ -1742,6 +1743,9 @@
            if limit_up_price:
                money_y = round((num * float(limit_up_price)) / 1e8, 1)
                money = int(200 * money_y + 280)
                if tool.trade_time_sub(place_order_time_str,"10:00:00") <= 0:
                    # 10点前下单打7折
                    money = int(money*0.7)
                count = int(money_y * 10) // 10 + 3
                return money, count
        # 默认值
@@ -1768,9 +1772,9 @@
        # 统计未撤订单的数量与金额
        total_datas = local_today_datas.get(code)
        # 是否是下单3分钟内
        if tool.trade_time_sub(tool.get_now_time_str(), total_datas[real_order_index]['val']['time']) > 3 * 60:
            return False, "下单超过180s"
        # 是否是下单1分钟内
        if tool.trade_time_sub(tool.get_now_time_str(), total_datas[real_order_index]['val']['time']) > 1 * 60:
            return False, "下单超过60s"
        THRESHOLD_MONEY_W, THRESHOLD_COUNT = self.__get_fast_deal_threshold_value(code)
third_data/data_server.py
@@ -500,20 +500,20 @@
            for d in record_limit_up_datas:
                if kpl_util.filter_block(d[2]) != plate:
                    continue
                # 代码,名称,涨停时间,是否炸板,是否想买,是否已经下过单
                # 代码,名称,涨停时间,是否炸板,是否想买,是否已经下过单,涨停时间,自由流通市值,是否在黑名单里面
                codes_info.append(
                    [d[3], d[4], tool.to_time_str(int(d[5])), 1 if d[3] not in now_limit_up_codes else 0, 0, 0, d[12],
                     output_util.money_desc(d[13]), 1])
                     output_util.money_desc(d[13]), 1, 1 if l2_trade_util.is_in_forbidden_trade_codes(d[3]) else 0])
            for d in record_limit_up_datas:
                if kpl_util.filter_block(d[2]) == plate:
                    continue
                if plate not in [kpl_util.filter_block(k) for k in d[6].split("、")]:
                    continue
                # 代码,名称,涨停时间,是否炸板,是否想买,是否已经下过单
                # 代码,名称,涨停时间,是否炸板,是否想买,是否已经下过单,涨停时间,自由流通市值,是否在黑名单里面
                codes_info.append(
                    [d[3], d[4], tool.to_time_str(int(d[5])), 1 if d[3] not in now_limit_up_codes else 0, 0, 0, d[12],
                     output_util.money_desc(d[13]), 0])
                     output_util.money_desc(d[13]), 0, 1 if l2_trade_util.is_in_forbidden_trade_codes(d[3]) else 0])
            codes_info.sort(key=lambda x: x[2])
            # 查询是否为想买单