| | |
| | | # 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: |
| | |
| | | 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): |
| | | """ |