| | |
| | | fdatas.append((time_str, code, type, data_json["data"])) |
| | | return fdatas |
| | | |
| | | |
| | | @cache_log |
| | | def load_cancel_buy_reasons(code, date=tool.get_now_date_str()): |
| | | """ |
| | |
| | | return fdatas |
| | | |
| | | |
| | | @cache_log |
| | | def load_huaxin_l2_sell_deal(code=None, date=tool.get_now_date_str()): |
| | | path = f"{constant.get_path_prefix()}/logs/huaxin/l2/sell_l2_deal.{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) |
| | | data = line.split(" - ")[1].strip() |
| | | if data.startswith("["): |
| | | data = data[data.find("]") + 1:].strip() |
| | | data = data.split("有涨停主动卖:")[1] |
| | | code_ = data[:6] |
| | | if code and code != code_: |
| | | continue |
| | | data = data[6:].strip() |
| | | volume = int(data.split("成交量-")[1].strip()) |
| | | if code_ not in fdatas: |
| | | fdatas[code_] = [] |
| | | fdatas[code_].append((time_str, volume)) |
| | | return fdatas |
| | | |
| | | |
| | | @cache_log |
| | | def load_huaxin_l2_sell_delegate(code=None, date=tool.get_now_date_str()): |
| | | path = f"{constant.get_path_prefix()}/logs/huaxin/l2/sell_l2_delegate.{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) |
| | | data = line.split(" - ")[1].strip() |
| | | if data.startswith("["): |
| | | data = data[data.find("]") + 1:].strip() |
| | | datas = data.split("-") |
| | | code_ = datas[0] |
| | | if code and code != code_: |
| | | continue |
| | | if code_ not in fdatas: |
| | | fdatas[code_] = [] |
| | | fdatas[code_].append((time_str, datas[1], eval(datas[2]))) |
| | | return fdatas |
| | | |
| | | |
| | | # 加载华鑫本地买入订单号 |
| | | def load_l2_market_data(): |
| | | path = f"{constant.get_path_prefix()}/logs/huaxin/l2/marketdata.{tool.get_now_date_str()}.log" |
| | |
| | | pass |
| | | return fdatas |
| | | |
| | | |
| | | @cache_log |
| | | def load_huaxin_active_sell_map(date=tool.get_now_date_str()): |
| | | path = f"{constant.get_path_prefix()}/logs/huaxin/trade/l2_active_sell.{date}.log" |