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();