feat: 添加边界防御机制使实盘行为与回测对齐

This commit is contained in:
2026-03-16 22:12:06 +08:00
parent 3c5a4c288a
commit a6aced2308
5 changed files with 3141 additions and 467 deletions

View File

@@ -236,12 +236,12 @@ if __name__ == "__main__":
# 这种方式适合获取相对较短或中等长度的历史K线数据。
df_if_backtest_daily = collect_and_save_tqsdk_data_stream(
symbol="KQ.m@SHFE.br",
symbol="KQ.m@CZCE.FG",
# symbol='SHFE.rb2510',
# symbol='KQ.i@SHFE.bu',
freq="min15",
start_date_str="2021-01-01",
end_date_str="2025-12-01",
start_date_str="2020-01-01",
end_date_str="2026-03-18",
mode="backtest", # 指定为回测模式
tq_user=TQ_USER_NAME,
tq_pwd=TQ_PASSWORD,