| | |
| | | else: |
| | | return int(val) |
| | | |
| | | def __save_current_price_codes_count(self,count): |
| | | key = "current_price_codes_count" |
| | | self.__get_redis().setex(key,10,count) |
| | | |
| | | def __get_current_price_codes_count(self): |
| | | key = "current_price_codes_count" |
| | | count = self.__get_redis().get(key) |
| | | return 0 if count is None else count |
| | | |
| | | def process_rate(self, code, rate, time_str): |
| | | # 9点半之前的数据不处理 |
| | | if int(time_str.replace(":", "")) < int("093000"): |
| | |
| | | global_util.cuurent_prices[code] = (price, is_limit_up, round(time.time())) |
| | | pass |
| | | |
| | | # 现价代码数量 |
| | | def save_current_price_codes_count(self, count): |
| | | self.__save_current_price_codes_count(count) |
| | | |
| | | def get_current_price_codes_count(self): |
| | | return self.__get_current_price_codes_count() |
| | | |
| | | |
| | | # 是否为水下捞 |
| | | def is_under_water(self, code): |
| | | time_seconds = self.__get_down_price_time_as_seconds(code) |