From 95ad45c096a7a743148a228752fcad379464b107 Mon Sep 17 00:00:00 2001 From: xxm Date: Sun, 2 Aug 2026 22:52:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A0=94=E7=A9=B6Tab=E6=94=AF=E6=8C=81?= =?UTF-8?q?10=E5=B9=B4=E5=9B=9E=E6=B5=8B=E5=8C=BA=E9=97=B4(v=5Fmr=2010y?= =?UTF-8?q?=E6=88=90=E7=BB=A9=E5=8F=AF=E8=A7=81)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - server.py: /api/research/backtest days映射补 5y(1825)/10y(3650),修复5y静默回退185天bug - static/index.html: 时间区间下拉加近10年选项 + ptMap加10y - 附带: mr_scanner v_mr实盘扫描器 + market_watch接入(2af2e934已含) --- server.py | 2 +- static/index.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index b706aaae..b37724af 100644 --- a/server.py +++ b/server.py @@ -556,7 +556,7 @@ def api_research_backtest(): market = request.args.get('market', 'all') # all | a | hk capital = float(request.args.get('capital', 1000000)) end_date = '2026-07-24' # 数据完整截止日 - days = {'1m': 30, '6m': 185, '1y': 365, '2y': 730}.get(period, 185) + days = {'1m': 30, '6m': 185, '1y': 365, '2y': 730, '5y': 1825, '10y': 3650}.get(period, 185) start_date = (datetime.strptime(end_date, '%Y-%m-%d') - timedelta(days=days)).strftime('%Y-%m-%d') try: from strategy_lab import run_backtest, analyze_trade_list, save_analysis diff --git a/static/index.html b/static/index.html index 5dc25c13..6968e98f 100644 --- a/static/index.html +++ b/static/index.html @@ -1934,7 +1934,7 @@ function renderResearch() { '

📋 策略研究 — 版本迭代对比

' + '' + + '' + '' + '每版策略基于上一版归因分析迭代 · 点击行展开明细' + @@ -1956,7 +1956,7 @@ function saveBtPeriod() { async function loadStrategyList() { const listEl = document.getElementById('strategyList'); try { - const ptMap = {'1m':'1m','6m':'6m','1y':'1y','2y':'2y','5y':'5y'}; + const ptMap = {'1m':'1m','6m':'6m','1y':'1y','2y':'2y','5y':'5y','10y':'10y'}; const pt = ptMap[window._btPeriodVal || document.getElementById('btPeriod')?.value || '2y'] || '2y'; const resp = await fetch('/api/research/strategies?period_tag=' + pt); const data = await resp.json();