| | |
| | | """ |
| | | # 代码涨幅数据 |
| | | __current_rate_dict = {} |
| | | __current_price_dict = {} |
| | | # 最近上传时间 |
| | | __latest_upload_time = 0 |
| | | |
| | |
| | | @param price: |
| | | @return: |
| | | """ |
| | | cls.__current_price_dict[code] = price |
| | | pre_close_price = CodePrePriceManager.get_price_pre_cache(code) |
| | | if pre_close_price: |
| | | rate = round((price - pre_close_price) * 100 / pre_close_price, 2) |
| | |
| | | def get_current_rate_dict(cls): |
| | | return cls.__current_rate_dict |
| | | |
| | | @classmethod |
| | | def get_current_price_dict(cls): |
| | | return cls.__current_price_dict |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | print(Buy1PriceManager().get_limit_up_info("002777")) |