| | |
| | | """ |
| | | 环境信息 |
| | | """ |
| | | import json |
| | | |
| | | from strategy.strategy_variable_factory import DataLoader |
| | | from third_data.history_k_data_manager import HistoryKDataManager |
| | | from third_data.kpl_block_manager import KPLCodeJXBlocksManager |
| | | from utils import tool |
| | | |
| | | |
| | |
| | | self.kpl_current_limit_up = ('', 0) |
| | | # Tick数据(更新时间, 数据数量) |
| | | self.ticks = ('', 0) |
| | | |
| | | def to_dict(self): |
| | | d = self.__dict__ |
| | | return d |
| | | |
| | | @classmethod |
| | | def to_obj(cls, json_str): |
| | | result = json.loads(json_str) |
| | | obj = RealTimeEnvInfo() |
| | | for k in result: |
| | | setattr(obj, k, result[k]) |
| | | return obj |
| | | |
| | | |
| | | def get_leading_limit_up_block_codes_count(day): |
| | |
| | | return count |
| | | |
| | | |
| | | def get_kpl_code_jx_blocks(day): |
| | | """ |
| | | 获取开盘啦代码精选板块数量 |
| | | @param day: |
| | | @return: |
| | | """ |
| | | count = KPLCodeJXBlocksManager(day, set()).get_all_code_blocks_count() |
| | | return count |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | print(get_history_k_bars("2025-06-04")) |
| | | RealTimeEnvInfo().kpl_current_limit_up = tool.get_now_time_str() |
| | | print(RealTimeEnvInfo().to_dict()) |