| | |
| | | fdatas.append((time_str, type, data_json["data"])) |
| | | return fdatas |
| | | |
| | | |
| | | def load_cancel_buy_reasons(code, date=tool.get_now_date_str()): |
| | | """ |
| | | 获取撤单原因 |
| | |
| | | @return: {真实下单位置:撤单原因} |
| | | """ |
| | | fdatas = load_trade_recod(code, date) |
| | | cancel_reason_dict={} |
| | | cancel_reason_dict = {} |
| | | for data in fdatas: |
| | | if data[1] != "cancel": |
| | | continue |
| | |
| | | codes = eval(data) |
| | | fdatas.append((time_str, codes)) |
| | | return fdatas |
| | | |
| | | |
| | | def load_kpl_limit_up_records(current_time_str, date=tool.get_now_date_str()): |
| | | """ |
| | | 获取离给定时间最近的涨停数据 |
| | | @param current_time_str: |
| | | @param date: |
| | | @return: |
| | | """ |
| | | path = f"{constant.get_path_prefix()}/logs/gp/kpl/kpl_limit_up.{date}.log" |
| | | lines = __load_file_content(path) |
| | | lines.reverse() |
| | | current_time_str_int = int(current_time_str.replace(":", "")) |
| | | for line in lines: |
| | | if line: |
| | | time_str = __get_log_time(line) |
| | | if int(time_str.replace(":", "")) < current_time_str_int: |
| | | line = line.split(" - ")[1] |
| | | return eval(line) |
| | | return None |
| | | |
| | | |
| | | # 加载华鑫本地买入订单号 |
| | |
| | | |
| | | |
| | | if __name__ == '__main__': |
| | | fdatas = get_real_place_order_positions("002404") |
| | | print(len(fdatas)) |
| | | fdatas = load_kpl_limit_up_records("10:00:00", "2024-10-21") |
| | | print(fdatas) |
| | | # print(get_h_cancel_compute_info("603912")) |
| | | |
| | | # logger_l2_h_cancel.info("test") |