From 89e49e197ec232fc6ae99c22b8ffb2be64108ee4 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期二, 19 八月 2025 12:17:22 +0800 Subject: [PATCH] 接口优化 --- cancel_strategy/s_l_h_cancel_strategy.py | 101 +++++++++++++++++++++++++------------------------- 1 files changed, 50 insertions(+), 51 deletions(-) diff --git a/cancel_strategy/s_l_h_cancel_strategy.py b/cancel_strategy/s_l_h_cancel_strategy.py index 9f28fa1..16ce320 100644 --- a/cancel_strategy/s_l_h_cancel_strategy.py +++ b/cancel_strategy/s_l_h_cancel_strategy.py @@ -610,13 +610,12 @@ # threshold_rate = max(threshold_rate, 0.79) threshold_rate = constant.L_CANCEL_RATE if constant.CAN_AUTO_L_DOWN_RATE_CHANGE: - # TODO 鏈�闀挎定鍋滄椂闂磋秴杩�1鍒嗛挓 try: if MaxPriceInfoManager().get_max_limit_up_time(code) > 60: 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: + if deal_big_order_info and deal_big_order_info[5]>5000e4: temp_rate = round(deal_big_order_info[1] / deal_big_order_info[5], 2) threshold_rate = min(max(temp_rate, 0.3), 0.9) except: @@ -2111,55 +2110,55 @@ not_deal_indexes] return all_money_list, deal_money_list, canceled_money_list, not_deal_money_list - def statistic_total_big_order_info(self, code): - """ - 缁熻L鍚庣殑澶у崟淇℃伅 - @param code: - @return: 鍥婃嫭閲戦鍒楄〃, 鎴愪氦閲戦鍒楄〃, 鎾ゅ崟閲戦鍒楄〃, 寰呮垚浜ゅ垪琛� - """ - trade_index, is_default = TradeBuyQueue().get_traded_index(code) - if trade_index is None: - trade_index = 0 - real_place_order_index_info = self.__real_place_order_index_dict.get(code) - if not real_place_order_index_info: - return None - total_datas = local_today_datas.get(code) - # 缁熻鍥婃嫭锛屽凡鎴愶紝宸叉挙锛屽緟鎴愪氦 - all_indexes = set() - deal_indexes = set() - canceled_indexes = set() - not_deal_indexes = set() - big_money_threshold = l2_data_util.get_big_money_val(gpcode_manager.get_limit_up_price_as_num(code), tool.is_ge_code(code)) - big_num_threshold = int(big_money_threshold/gpcode_manager.get_limit_up_price_as_num(code)/100) - for index in range(0,total_datas[-1]): - data = total_datas[index] - val = data["val"] - if val['num']<big_num_threshold: - continue - if not L2DataUtil.is_limit_up_price_buy(val): - continue - all_indexes.add(index) - left_count = l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_no_canceled_count_v2(code, - index, - total_datas, - local_today_canceled_buyno_map.get( - code)) - if left_count == 0: - canceled_indexes.add(index) - continue - if index < trade_index: - deal_indexes.add(index) - continue - not_deal_indexes.add(index) - all_money_list = [int(float(total_datas[x]['val']['price'] * total_datas[x]['val']['num'] * 100)) for x in - all_indexes] - deal_money_list = [int(float(total_datas[x]['val']['price'] * total_datas[x]['val']['num'] * 100)) for x in - deal_indexes] - canceled_money_list = [int(float(total_datas[x]['val']['price'] * total_datas[x]['val']['num'] * 100)) for x in - canceled_indexes] - not_deal_money_list = [int(float(total_datas[x]['val']['price'] * total_datas[x]['val']['num'] * 100)) for x in - not_deal_indexes] - return all_money_list, deal_money_list, canceled_money_list, not_deal_money_list + # def statistic_total_big_order_info(self, code): + # """ + # 缁熻L鍚庣殑澶у崟淇℃伅 + # @param code: + # @return: 鍥婃嫭閲戦鍒楄〃, 鎴愪氦閲戦鍒楄〃, 鎾ゅ崟閲戦鍒楄〃, 寰呮垚浜ゅ垪琛� + # """ + # trade_index, is_default = TradeBuyQueue().get_traded_index(code) + # if trade_index is None: + # trade_index = 0 + # real_place_order_index_info = self.__real_place_order_index_dict.get(code) + # if not real_place_order_index_info: + # return None + # total_datas = local_today_datas.get(code) + # # 缁熻鍥婃嫭锛屽凡鎴愶紝宸叉挙锛屽緟鎴愪氦 + # all_indexes = set() + # deal_indexes = set() + # canceled_indexes = set() + # not_deal_indexes = set() + # big_money_threshold = l2_data_util.get_big_money_val(gpcode_manager.get_limit_up_price_as_num(code), tool.is_ge_code(code)) + # big_num_threshold = int(big_money_threshold/gpcode_manager.get_limit_up_price_as_num(code)/100) + # for index in range(0,total_datas[-1]): + # data = total_datas[index] + # val = data["val"] + # if val['num']<big_num_threshold: + # continue + # if not L2DataUtil.is_limit_up_price_buy(val): + # continue + # all_indexes.add(index) + # left_count = l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_no_canceled_count_v2(code, + # index, + # total_datas, + # local_today_canceled_buyno_map.get( + # code)) + # if left_count == 0: + # canceled_indexes.add(index) + # continue + # if index < trade_index: + # deal_indexes.add(index) + # continue + # not_deal_indexes.add(index) + # all_money_list = [int(float(total_datas[x]['val']['price'] * total_datas[x]['val']['num'] * 100)) for x in + # all_indexes] + # deal_money_list = [int(float(total_datas[x]['val']['price'] * total_datas[x]['val']['num'] * 100)) for x in + # deal_indexes] + # canceled_money_list = [int(float(total_datas[x]['val']['price'] * total_datas[x]['val']['num'] * 100)) for x in + # canceled_indexes] + # not_deal_money_list = [int(float(total_datas[x]['val']['price'] * total_datas[x]['val']['num'] * 100)) for x in + # not_deal_indexes] + # return all_money_list, deal_money_list, canceled_money_list, not_deal_money_list def statistic_l_down_watch_indexes_info(self, code): """ -- Gitblit v1.8.0