| | |
| | | |
| | | # 导出交易取消日志 |
| | | def __export_l2_trade_cancel_log(code, date, dir): |
| | | LogUtil.extract_log_from_key(code, "{}/sell_logs/gp/l2/l2_trade_cancel.{}.log".format(constant.get_path_prefix(), date), |
| | | LogUtil.extract_log_from_key(code, |
| | | "{}/sell_logs/gp/l2/l2_trade_cancel.{}.log".format(constant.get_path_prefix(), date), |
| | | "{}/l2_trade_cancel_{}.log".format(dir, date)) |
| | | |
| | | |
| | |
| | | return pos_list |
| | | |
| | | |
| | | |
| | | __log_file_contents = {} |
| | | |
| | | |
| | |
| | | contents.append(line) |
| | | __log_file_contents[md5] = (time.time(), contents) |
| | | return contents |
| | | |
| | | |
| | | |
| | | # 加载l2订单成交数据 |
| | |
| | | data = eval(data) |
| | | fdatas.append(data) |
| | | return fdatas |
| | | |
| | | |
| | | |
| | | # 加载华鑫成交的卖单 |
| | |
| | | fdatas[code_] = [] |
| | | fdatas[code_].append(eval(data)) |
| | | return fdatas |
| | | |
| | | |
| | | |
| | | |
| | | # 读取系统日志 |
| | |
| | | pass |
| | | return fdatas |
| | | |
| | | |
| | | # 读取成交的大买单 |
| | | def load_huaxin_transaction_big_buy_order_infos(date=tool.get_now_date_str()): |
| | | path = f"{constant.get_path_prefix()}/sell_logs/huaxin/l2/transaction_big_buy_order.{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: |
| | | try: |
| | | data = line.split(" - ")[1].strip() |
| | | if data.startswith("["): |
| | | data = data[data.find("]") + 1:].strip() |
| | | code = data.split("#")[0] |
| | | l2_data = eval(data.split("#")[1]) |
| | | if code not in fdatas: |
| | | fdatas[code] = [] |
| | | fdatas[code].append(l2_data) |
| | | except: |
| | | pass |
| | | return fdatas |
| | | |
| | | |
| | | # 读取成交的大卖单 |
| | | def load_huaxin_transaction_big_sell_order_infos(date=tool.get_now_date_str()): |
| | | path = f"{constant.get_path_prefix()}/sell_logs/huaxin/l2/transaction_big_sell_order.{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: |
| | | try: |
| | | data = line.split(" - ")[1].strip() |
| | | if data.startswith("["): |
| | | data = data[data.find("]") + 1:].strip() |
| | | code = data.split("#")[0] |
| | | l2_data = eval(data.split("#")[1]) |
| | | if code not in fdatas: |
| | | fdatas[code] = [] |
| | | fdatas[code].append(l2_data) |
| | | except: |
| | | pass |
| | | return fdatas |