| | |
| | | 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 get_current_price(self, code): |
| | | return global_util.cuurent_prices.get(code) |
| | | |
| | | # 现价代码数量 |
| | | def save_current_price_codes_count(self, count): |
| | | self.__save_current_price_codes_count(count) |
| | |
| | | else: |
| | | return time_seconds >= constant.UNDER_WATER_PRICE_TIME_AS_SECONDS |
| | | |
| | | # 当前代码是否涨停 |
| | | def current_is_limit_up(self, code): |
| | | data = self.get_current_price(code) |
| | | if data is None: |
| | | return None |
| | | return data[1] |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | processor = CodeActualPriceProcessor() |