Administrator
2024-02-28 beb099afd0440d23430d41ca72efad6a9a5b565b
bug修改
2个文件已修改
13 ■■■■■ 已修改文件
huaxin_client/l2_data_manager.py 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/cancel_buy_strategy.py 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
huaxin_client/l2_data_manager.py
@@ -158,6 +158,7 @@
    def release_distributed_upload_queue(self, code):
        self.order_queue_distribute_manager.release_distribute_queue(code)
        self.transaction_queue_distribute_manager.release_distribute_queue(code)
        self.l2_order_upload_protocol.release_distributed_upload_host(code)
        if code in self.temp_order_queue_dict:
            self.temp_order_queue_dict[code].clear()
            self.temp_order_queue_dict.pop(code)
@@ -166,7 +167,7 @@
            self.temp_transaction_queue_dict.pop(code)
        if code in self.upload_l2_data_task_dict:
            self.upload_l2_data_task_dict.pop(code)
        self.l2_order_upload_protocol.release_distributed_upload_host(code)
    def __upload_l2_data(self, code, _queue, datas):
        _queue.put_nowait((code, datas, time.time()))
@@ -263,6 +264,8 @@
    # 分配HOST
    def distribute_upload_host(self, code):
        if code in self.code_socket_client_dict:
            return
        self.rlock.acquire()
        try:
            host_info = self.__get_available_ipchost()
@@ -272,6 +275,8 @@
            self.rlock.release()
    def release_distributed_upload_host(self, code):
        if code not in self.code_socket_client_dict:
            return
        self.rlock.acquire()
        try:
            if code in self.code_socket_client_dict:
l2/cancel_buy_strategy.py
@@ -1748,11 +1748,9 @@
            if left_count > 0:
                total_left_count += left_count
                total_left_num += val["num"] * left_count
        if total_left_count < 10:
            return True, f"剩余笔数不足({total_left_count}),成交进度:{trade_index},真实下单位置:{real_order_index}"
        limit_up_price = gpcode_manager.get_limit_up_price(code)
        if limit_up_price and total_left_num * float(limit_up_price) < 1000*100:
            return True, f"剩余金额不足({round(total_left_num * float(limit_up_price)*100)}),成交进度:{trade_index},真实下单位置:{real_order_index}"
        if total_left_count < 10 and limit_up_price and total_left_num * float(limit_up_price) < 1000*100:
            return True, f"剩余笔数({total_left_count})/金额({round(total_left_num * float(limit_up_price)*100)})不足,成交进度:{trade_index},真实下单位置:{real_order_index}"
        return False, "不满足撤单条件"