fix: 资格判定用当前激活温区(state)优先,best_regime回退——择优激活的v_lurk_v3不再被choppy误判
This commit is contained in:
@@ -824,9 +824,18 @@ def api_research_strategies():
|
||||
'bench_10y': _qbench_for_mkt.get('10y'), 'bench_2y': _qbench_for_mkt.get('2y'),
|
||||
'bench_1y': _qbench_for_mkt.get('1y'),
|
||||
}
|
||||
# ── 2026-08-16 资格判定用【策略自身适应温区 best_regime】的 qualification ──
|
||||
# (bug修复:原用当前市场温区,趋势市策略在当前温区(如trend_down)无资格数据→误判不合格)
|
||||
_qual_rg = s.get('best_regime') or _weights.get('state') or ''
|
||||
# ── 2026-08-17 资格判定用【当前激活温区 weights.state】优先,best_regime 回退 ──
|
||||
# (2026-08-16 原用 best_regime:择优激活按当前温区选策略(如trend_down激活v_lurk_v3),
|
||||
# 但best_regime(choppy)判定会误判——v_lurk_v3在trend_down达标却被判不合格)
|
||||
# 当前温区有资格数据 → 用当前温区;否则回退策略自身适应温区
|
||||
_state_rg = _weights.get('state') or ''
|
||||
_state_q = (s.get('qualification') or {}).get(_state_rg)
|
||||
_best_rg = s.get('best_regime') or ''
|
||||
_best_q = (s.get('qualification') or {}).get(_best_rg)
|
||||
if _state_q and (_state_q.get('cagr_10y') is not None):
|
||||
_qual_rg = _state_rg
|
||||
else:
|
||||
_qual_rg = _best_rg
|
||||
_cur_regime_q = (s.get('qualification') or {}).get(_qual_rg)
|
||||
_l_ok = bool(_cur_regime_q and _cur_regime_q.get('long_ok'))
|
||||
_m_ok = bool(_cur_regime_q and _cur_regime_q.get('mid_ok'))
|
||||
|
||||
Reference in New Issue
Block a user