From 2ccd2ee1112ee84f5139fc5b8cf2ce070f8f991e Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期二, 31 十二月 2024 17:20:17 +0800 Subject: [PATCH] 测试 --- huaxin_client/l1_api_client.py | 14 +++++++------- api/outside_api_command_callback.py | 4 +++- third_data/hx_qc_value_util.py | 2 -- third_data/history_k_data_manager.py | 5 ++++- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/api/outside_api_command_callback.py b/api/outside_api_command_callback.py index 928f7f3..dd7c54d 100644 --- a/api/outside_api_command_callback.py +++ b/api/outside_api_command_callback.py @@ -487,7 +487,7 @@ try: fdata = {} try: - date = HistoryKDatasUtils.get_previous_trading_date(tool.get_now_date_str()) + date = HistoryKDatasUtils.get_trading_dates(tool.date_sub(tool.get_now_date_str(), 10) ,tool.get_now_date_str()) if date: fdata["juejin"] = 1 except Exception as e: @@ -545,6 +545,7 @@ # 鑾峰彇浠婃棩K绾跨殑鏇存柊鏁伴噺 try: dates = HistoryKDatasUtils.get_latest_trading_date_cache(5) + logger_debug.info(f"鑾峰彇鍒扮殑浜ゆ槗鏃ワ細{dates}") latest_trading_date = None if dates: latest_trading_date = dates[0] @@ -552,6 +553,7 @@ raise Exception("娌℃湁鑾峰彇鍒颁笂涓�涓氦鏄撴棩鐨勬棩鏈�") codes = HistoryKDataManager().get_history_bars_codes(latest_trading_date) count = len(codes) + logger_debug.info(f"K绾夸唬鐮佹暟閲忥細{count}") fdata["today_history_k_bar_count"] = count except Exception as e: logger_debug.exception(e) diff --git a/huaxin_client/l1_api_client.py b/huaxin_client/l1_api_client.py index 09481f6..237c4f8 100644 --- a/huaxin_client/l1_api_client.py +++ b/huaxin_client/l1_api_client.py @@ -3,8 +3,9 @@ import threading import time +import constant import qcvalueaddproapi -from log_module.log import logger_system, logger_debug +from log_module.log import logger_system from utils import tool global g_userid, g_passwd, g_address, g_port, g_seqnum @@ -250,7 +251,6 @@ while True: try: val = request_queue.get() - logger_debug.info(f"璇诲彇鍗庨懌澧炲�兼湇鍔¤姹傦細{val}") type_ = val['type'] request_id = val['request_id'] data = val.get('data') @@ -268,7 +268,7 @@ results = thespi.queryBars(code, start_date, end_date) __set_response_data(request_id, results) except Exception as e: - logger_debug.exception(e) + pass def run(request_queue: multiprocessing.Queue, response_queue: multiprocessing.Queue): @@ -283,10 +283,10 @@ g_port = 25556 g_userid = "388000013942" g_passwd = "110808" - - # 鍐呯綉 - g_address = "192.168.84.61" - g_port = 25557 + if not constant.is_windows(): + # 鍐呯綉 + g_address = "192.168.84.61" + g_port = 25557 #IP锛�192.168.84.61锛夈�佺鍙o紙25557 diff --git a/third_data/history_k_data_manager.py b/third_data/history_k_data_manager.py index 4a286fa..fa7c94a 100644 --- a/third_data/history_k_data_manager.py +++ b/third_data/history_k_data_manager.py @@ -24,7 +24,6 @@ for code in codes_: try: datas = init_data_util.get_volumns_by_code(code, 150) - logger_debug.info(f"鑾峰彇鍒扮殑K绾匡細{datas}") if datas: HistoryKDataManager().save_history_bars(code, datas[0]['bob'].strftime("%Y-%m-%d"), datas) except Exception as e: @@ -187,3 +186,7 @@ if file.find(day) >= 0: codes.add(file.split("_")[1][:6]) return codes + + +if __name__ == "__main__": + print(HistoryKDataManager().get_history_bars_codes("2024-12-31")) diff --git a/third_data/hx_qc_value_util.py b/third_data/hx_qc_value_util.py index 477141b..2807e94 100644 --- a/third_data/hx_qc_value_util.py +++ b/third_data/hx_qc_value_util.py @@ -70,7 +70,6 @@ @param end_date: @return: """ - logger_debug.info("get_history_k_bars寮�濮�") load_latest_trade_calendar() _count = -1 start_date = None @@ -85,7 +84,6 @@ start_date = __trade_calendar_list[i] if _count >= count: break - logger_debug.info(f"get_history_k_bars 鑾峰彇鍒板紑濮嬫棩鏈燂細{start_date}") request_id = __base_request("get_history_k_bars", {"start_date": start_date, "end_date": end_date, "code": code}) return __read_response(request_id) -- Gitblit v1.8.0