| | |
| | | return contents |
| | | |
| | | |
| | | def load_stock_of_markets_plate(date=tool.get_now_date_str()): |
| | | def load_market_stock_heat(date=tool.get_now_date_str()): |
| | | """ |
| | | 获取精选流入的成分股 |
| | | :param date: |
| | | :return: |
| | | """ |
| | | path = f"{constant.get_path_prefix()}/low_suction_log/gp/kpl/market_sift_plate.{date}.log" |
| | | fdatas = [] |
| | | if os.path.exists(path): |
| | | with open(path, 'r', encoding="utf-8") as f: |
| | | lines = f.readlines() |
| | | for line in lines: |
| | | if line: |
| | | time_str = __get_async_log_time(line) |
| | | try: |
| | | data = line.split(" - ")[1].strip() |
| | | if data.startswith("["): |
| | | data = data[data.find("]") + 1:].strip() |
| | | data_dict = eval(data) |
| | | fdatas.append((time_str, data_dict)) |
| | | except: |
| | | pass |
| | | return fdatas |
| | | |
| | | |
| | | def load_kpl_market_stock_heat(date=tool.get_now_date_str()): |
| | | """ |
| | | 获取精选流入的成分股 |
| | | :param date: |
| | |
| | | pass |
| | | return fdatas |
| | | |
| | | |
| | | def load_kpl_market_strong(date=tool.get_now_date_str()): |
| | | """ |
| | | 获取开盘啦历史强度 |
| | | :param date: |
| | | :return: [("时间","分数")] |
| | | """ |
| | | path = f"{constant.get_path_prefix()}/low_suction_log/gp/kpl/Overall_market_strength_score.{date}.log" |
| | | fdatas = [] |
| | | if os.path.exists(path): |
| | | with open(path, 'r', encoding="utf-8") as f: |
| | | lines = f.readlines() |
| | | for line in lines: |
| | | if line: |
| | | time_str = __get_async_log_time(line) |
| | | try: |
| | | data = line.split(" - ")[1].strip() |
| | | if data.startswith("["): |
| | | data = data[data.find("]") + 1:].strip() |
| | | fdatas.append((time_str, int(data))) |
| | | except: |
| | | pass |
| | | return fdatas |
| | | |
| | | |
| | | if __name__ == '__main__': |
| | | load_stock_of_markets_plate() |
| | | datas = load_kpl_market_strong() |
| | | fdatas = [] |
| | | for data in datas: |
| | | # (距离09:15:00的秒数, 时间, 强度) |
| | | if "11:30:00"<= data[0]<="13:00:00": |
| | | continue |
| | | fdatas.append([tool.trade_time_sub(data[0], "09:15:00"), data[0], data[1]]) |
| | | print(fdatas) |