| | |
| | | """ |
| | | L后统计信息管理 |
| | | """ |
| | | |
| | | def __init__(self): |
| | | self.watch_indexes_statistic_info_dict = {} |
| | | self.__db = 0 |
| | |
| | | self.watch_indexes_statistic_info_dict[code] = val |
| | | |
| | | def get_statistic_info(self, code): |
| | | return self.watch_indexes_statistic_info_dict.get(code) |
| | | return self.watch_indexes_statistic_info_dict.get(code) |
| | | |
| | | def remove_statistic_info(self, code): |
| | | if code not in self.watch_indexes_statistic_info_dict: |
| | |
| | | self.watch_indexes_statistic_info_dict[code] = val |
| | | RedisUtils.setex_async(self.__db, f"l_down_watch_indexes_statistic_info-{code}", tool.get_expire(), |
| | | json.dumps(val)) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | # 计算成交位置之后的大单(特定笔数)的撤单比例 |
| | |
| | | # 计算已经成交的比例 |
| | | total_datas = local_today_datas.get(code) |
| | | total_deal_nums, total_nums, total_cancel_num, total_after_num = 0, 0, 0, 0 |
| | | total_deal_count, total_count, total_cancel_count, total_after_count = 0, 0, 0, 0 |
| | | for index in watch_indexes_info[2]: |
| | | data = total_datas[index] |
| | | val = data["val"] |
| | |
| | | local_today_canceled_buyno_map.get( |
| | | code)) |
| | | total_nums += val["num"] |
| | | total_count += 1 |
| | | |
| | | if index > real_place_order_index_info[0]: |
| | | # L后后半段 |
| | | total_after_num += val["num"] |
| | | total_after_count += 1 |
| | | if left_count <= 0: |
| | | total_cancel_num += val["num"] |
| | | total_cancel_count += 1 |
| | | else: |
| | | if index < trade_index: |
| | | total_deal_nums += val["num"] |
| | | total_deal_count += 1 |
| | | # 总单 |
| | | # 已撤单 |
| | | # 成交单 |
| | | fresults = [(total_nums, int(total_nums * limit_up_price * 100)), |
| | | (total_cancel_num, int(total_cancel_num * limit_up_price * 100)), |
| | | (total_deal_nums, int(total_deal_nums * limit_up_price * 100))] |
| | | fresults = [(total_count, int(total_nums * limit_up_price * 100)), |
| | | (total_cancel_count, int(total_cancel_num * limit_up_price * 100)), |
| | | (total_deal_count, int(total_deal_nums * limit_up_price * 100))] |
| | | if total_nums - total_after_num <= 0: |
| | | fresults.append(100.00) |
| | | else: |
| | | fresults.append(round(total_cancel_num * 100 / (total_nums - total_after_num), 2)) |
| | | fresults.append(LCancelRateManager.get_cancel_rate(code)[0]) |
| | | fresults.append(LCancelRateManager.get_cancel_rate(code)[0]*100) |
| | | return fresults |
| | | |
| | | |