From 2f00a0565dcf8d652b8bb5c4caefbce1c2c92d62 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期一, 23 六月 2025 09:58:15 +0800 Subject: [PATCH] bug修复/策略完善 --- strategy/time_series_backtest.py | 24 +++++++++++++++--------- 1 files changed, 15 insertions(+), 9 deletions(-) diff --git a/strategy/time_series_backtest.py b/strategy/time_series_backtest.py index aa984fb..3f6bbd8 100644 --- a/strategy/time_series_backtest.py +++ b/strategy/time_series_backtest.py @@ -122,15 +122,15 @@ :return: 鎸夋椂闂存帓搴忕殑鏁版嵁鍒楄〃 """ if self.day >= '2025-05-26': - IS_BY_BIG_ORDER = True - else: IS_BY_BIG_ORDER = False + else: + IS_BY_BIG_ORDER = True day = self.day fdata = {} __LowSuctionOriginDataExportManager = LowSuctionOriginDataExportManager(day) all_limit_up_list = __LowSuctionOriginDataExportManager.export_limit_up_list() fdata["limit_up_list"] = {d[0][:8]: d[1] for d in all_limit_up_list} - big_order_deals = __LowSuctionOriginDataExportManager.export_big_order_deal(BIG_ORDER_MONEY_THRESHOLD) + big_order_deals = __LowSuctionOriginDataExportManager.export_big_order_deal(BIG_ORDER_MONEY_THRESHOLD, max_deal_space=3) if not big_order_deals or IS_BY_BIG_ORDER: big_order_deals = __LowSuctionOriginDataExportManager.export_big_order_deal_by(BIG_ORDER_MONEY_THRESHOLD) # 杞崲鏍煎紡涓猴細{鏃堕棿: [("浠g爜", (涔板崟鍙�, 閲�, 閲戦, 鏃堕棿, 鏈�缁堟垚浜や环))] @@ -358,7 +358,7 @@ # self.fcodes, self.head_rise_code_blocks = self.__get_target_codes_v3() # __filter_codes(current_data, timeline_data) self.fcodes, self.head_rise_code_blocks = self.__get_target_codes_v4(), {} - print(len(self.fcodes), self.fcodes) + print(len(self.fcodes)) if not self.current_tick_data: try: self.current_tick_data = self.load_current_tick_datas(self.data_loader) @@ -700,6 +700,8 @@ code = big_order[0] if code not in self.fcodes: continue + if DEBUG_CODES and code not in DEBUG_CODES: + continue self.init_stock_variables(code, self.timeline_data, self.current_data) stock_variables: StockVariables = self.stock_variables_dict.get(code) if plate_limit_up_codes_info is not None: @@ -724,6 +726,7 @@ self.__process_test_result(code, stock_variables, next_trade_day, big_order[1][4], huaxin_util.convert_time(big_order[1][3]), compute_result) except Exception as e: + print(time_str) logging.exception(e) print("鍙拱棰樻潗锛�", all_new_plates) @@ -794,7 +797,9 @@ stock_variables.鏉垮潡鎴愪氦浠g爜 = self.deal_block_codes -# DEBUG_CODES = ['603579', '300884'] +# 閿傜數姹� ['002882', '002667', '002846', '300530', '002074', '301662', '002580', '300584', '603399', '601515'] +# 鍖栧伐 ['600610', '002427', '002165', '002809', '000565', '002365', '603192', '600370', '600800', '603188'] +# DEBUG_CODES = ['600610', '002427', '002165', '002809', '000565', '002365', '603192', '600370', '600800', '603188'] DEBUG_CODES = [] VOLUME_LOG_ENABLE = False @@ -807,11 +812,12 @@ if __name__ == "__main__": back_test_dict = {} - # days = ["2025-05-12", "2025-05-13", "2025-05-14", "2025-05-15", "2025-05-16", "2025-05-19", "2025-05-20", - # "2025-05-21", "2025-05-22", "2025-05-23", "2025-05-26", "2025-05-27", "2025-05-28", "2025-05-29", - # "2025-05-30", "2025-06-03"] + days = ["2025-05-12", "2025-05-13", "2025-05-14", "2025-05-15", "2025-05-16", "2025-05-19", "2025-05-20", + "2025-05-21", "2025-05-22", "2025-05-23", "2025-05-26", "2025-05-27", "2025-05-28", "2025-05-29", + "2025-05-30", "2025-06-03"] days = ["2025-06-03", "2025-06-04", "2025-06-05", "2025-06-06", "2025-06-09", "2025-06-10", - "2025-06-11", "2025-06-12", "2025-06-13", "2025-06-16", "2025-06-17", "2025-06-18"] + "2025-06-11", "2025-06-12", "2025-06-13", "2025-06-16", "2025-06-17", "2025-06-18", "2025-06-19", + "2025-06-20"] # days = ["2025-05-23"] -- Gitblit v1.8.0