| | |
| | | # 设置历史量 |
| | | def set_histry_volumn(code, max60, yesterday, max60_day, max60_day_count): |
| | | redis = __redis_manager.getRedis() |
| | | global_util.max60_volumn[code] = (max60, max60_day) |
| | | global_util.max60_volumn[code] = (max60, max60_day,max60_day_count) |
| | | global_util.yesterday_volumn[code] = yesterday |
| | | try: |
| | | RedisUtils.setex_async(0, "volumn_max60-{}".format(code), tool.get_expire(), |
| | |
| | | today = get_today_volumn(code) |
| | | max60, yesterday = get_histry_volumn(code) |
| | | if today is None or max60 is None or yesterday is None: |
| | | raise Exception("获取量失败") |
| | | raise Exception(f"获取量失败:{code}") |
| | | rate = round((int(today) + total_sell_volume) / max(int(max60[0]), int(yesterday)), 2) |
| | | if not with_info: |
| | | return rate |