fix: state资格判定改用策略自身适应温区(best_regime)——趋势市策略/港股策略不再因当前温区无数据误判不合格
This commit is contained in:
@@ -808,8 +808,10 @@ def api_research_strategies():
|
|||||||
'bench_10y': _qbench_data.get('10y'), 'bench_2y': _qbench_data.get('2y'),
|
'bench_10y': _qbench_data.get('10y'), 'bench_2y': _qbench_data.get('2y'),
|
||||||
'bench_1y': _qbench_data.get('1y'),
|
'bench_1y': _qbench_data.get('1y'),
|
||||||
}
|
}
|
||||||
# 当前温区资格(激活判定用)
|
# ── 2026-08-16 资格判定用【策略自身适应温区 best_regime】的 qualification ──
|
||||||
_cur_regime_q = (s.get('qualification') or {}).get(_weights.get('state') or '')
|
# (bug修复:原用当前市场温区,趋势市策略在当前温区(如trend_down)无资格数据→误判不合格)
|
||||||
|
_qual_rg = s.get('best_regime') or _weights.get('state') or ''
|
||||||
|
_cur_regime_q = (s.get('qualification') or {}).get(_qual_rg)
|
||||||
_l_ok = bool(_cur_regime_q and _cur_regime_q.get('long_ok'))
|
_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'))
|
_m_ok = bool(_cur_regime_q and _cur_regime_q.get('mid_ok'))
|
||||||
_s_ok = bool(_cur_regime_q and _cur_regime_q.get('short_ok'))
|
_s_ok = bool(_cur_regime_q and _cur_regime_q.get('short_ok'))
|
||||||
|
|||||||
Reference in New Issue
Block a user