From 92cb2dd75ea37b64b174f42ddd0b5b17d6a4634a Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期四, 16 二月 2023 16:04:11 +0800 Subject: [PATCH] H撤策略优化,新增热门板块爬取,新增windows截图工具 --- server.py | 30 ++++++++++++++++++++---------- 1 files changed, 20 insertions(+), 10 deletions(-) diff --git a/server.py b/server.py index c0d9c50..aad4ae7 100644 --- a/server.py +++ b/server.py @@ -99,7 +99,7 @@ origin_start_time = round(time.time() * 1000) __start_time = round(time.time() * 1000) - do_id = random.randint(0, 100000) + # level2鐩樺彛鏁版嵁 day, client, channel, code, capture_time, process_time, datas, origin_datas = l2.l2_data_util.parseL2Data( _str) @@ -139,8 +139,7 @@ __start_time = l2_data_log.l2_time(code, round(time.time() * 1000) - __start_time, "l2澶栭儴鏁版嵁棰勫鐞嗚�楁椂") - l2_data_manager_new.L2TradeDataProcessor.process(code, datas, capture_timestamp, - do_id) + l2_data_manager_new.L2TradeDataProcessor.process(code, datas, capture_timestamp) __start_time = l2_data_log.l2_time(code, round(time.time() * 1000) - __start_time, "l2鏁版嵁鏈夋晥澶勭悊澶栭儴鑰楁椂", @@ -308,17 +307,28 @@ try: buy_one_price_ = decimal.Decimal(round(float(buy_one_price), 2)).quantize( decimal.Decimal("0.00")) - buy_progress_index = self.tradeBuyQueue.compute_traded_index(code, buy_one_price_, - buy_queue_result_list) + # 鑾峰彇鎵ц浣嶆椂闂� + exec_time = None + buy_single_index, buy_exec_index, compute_index, num, count, max_num_set = l2_data_manager.TradePointManager.get_buy_compute_start_data( + code) + if buy_exec_index: + try: + exec_time = l2.l2_data_util.local_today_datas.get(code)[buy_exec_index]["val"]["time"] + except: + pass + + buy_progress_index = self.tradeBuyQueue.compute_traded_index(code, buy_one_price_, buy_queue_result_list,exec_time) if buy_progress_index is not None: - HourCancelBigNumComputer.set_trade_progress(code, buy_progress_index, + HourCancelBigNumComputer.set_trade_progress(code,buy_time,buy_exec_index, buy_progress_index, l2.l2_data_util.local_today_datas.get( code), l2.l2_data_util.local_today_num_operate_map.get( code)) - logger_l2_trade_buy_queue.info("鑾峰彇鎴愪氦浣嶇疆鎴愬姛锛� code-{} index-{} 鏁版嵁-{}", code, - buy_progress_index, - json.dumps(buy_queue_result_list)) + logger_l2_trade_buy_queue.info("鑾峰彇鎴愪氦浣嶇疆鎴愬姛锛� code-{} index-{} 鏁版嵁-{}", code, + buy_progress_index, + json.dumps(buy_queue_result_list)) + else: + raise Exception("鏆傛湭鑾峰彇鍒颁氦鏄撹繘搴�") except Exception as e: logging.exception(e) print("涔板叆闃熷垪", code, buy_queue_result_list) @@ -364,7 +374,7 @@ volumn = item["volumn"] volumnUnit = item["volumnUnit"] code_volumn_manager.save_today_volumn(item["code"], volumn, volumnUnit) - juejin.accpt_prices(data) + juejin.accept_prices(data) elif type == 50: data = data_process.parse(_str)["data"] if data is not None: -- Gitblit v1.8.0