fix: _missing_active激活策略description也fallback到name/summary——激活但策略库无记录的策略(s2_panic等)说明列不再空

This commit is contained in:
hmo
2026-08-15 09:59:34 +08:00
parent 4d67bf05f0
commit 13790e0cb6
+8
View File
@@ -661,6 +661,14 @@ def api_research_strategies():
continue continue
_entry = dict(_s10) _entry = dict(_s10)
_entry['description'] = STRATEGY_DESCRIPTIONS.get(_mv, {}) _entry['description'] = STRATEGY_DESCRIPTIONS.get(_mv, {})
# 2026-08-15:激活但策略库无记录的策略,description fallback 到 name/summary(说明列不再空)
if not _entry['description'] and (_entry.get('name') or _entry.get('summary')):
_entry['description'] = {
'title': _entry.get('name') or _mv,
'algorithm': _entry.get('summary') or '',
'rationale': _entry.get('hypothesis') or '',
'evidence': '',
}
_entry['regime_winrates'] = _regime_winrates.get(_mv, {}) _entry['regime_winrates'] = _regime_winrates.get(_mv, {})
_entry['current'] = True _entry['current'] = True
_entry['note'] = f"({pt or '当前周期'}无回测记录,显示10y数据)" _entry['note'] = f"({pt or '当前周期'}无回测记录,显示10y数据)"