feat: v_next3生产落地——板块ADX入板块上下文+行业牛杠杆接入position_advice
This commit is contained in:
@@ -1040,6 +1040,27 @@ def reassess_strategy(code, name, price, cost, shares, current_action,
|
||||
|
||||
print(f" 分类: {stock_category} | {time_horizon} | {position_advice}")
|
||||
|
||||
# ── v_next3行业牛杠杆: 行业确认牛(行业ADX>25)时升一档仓位(2026-07-30落地)──
|
||||
try:
|
||||
_sec_adx = 0
|
||||
try:
|
||||
from strategy_lab import sector_ctx, prepare_sector_context
|
||||
from datetime import timedelta as _td
|
||||
_end = datetime.now().strftime('%Y-%m-%d')
|
||||
_start = (datetime.now() - _td(days=200)).strftime('%Y-%m-%d')
|
||||
prepare_sector_context(_start, _end)
|
||||
_sc = sector_ctx(code, _end)
|
||||
_sec_adx = _sc.get('adx') or 0
|
||||
except Exception:
|
||||
_sec_adx = 0
|
||||
if _sec_adx > 25:
|
||||
_upgrade = {"小仓快进快出": "中等仓位", "中等仓位": "重仓", "正常配置": "重仓"}
|
||||
if position_advice in _upgrade:
|
||||
print(f" [行业牛杠杆] 行业ADX={_sec_adx:.0f}>25 → 仓位{position_advice}→{_upgrade[position_advice]}", flush=True)
|
||||
position_advice = _upgrade[position_advice]
|
||||
except Exception as _e:
|
||||
print(f" [行业牛杠杆] 评估异常(跳过): {_e}", flush=True)
|
||||
|
||||
# ----- 短炒+强趋势检测:短炒分类但多周期多头时用移动止损代替弱支撑止损 -----
|
||||
is_short_term_strong_trend = False
|
||||
if stock_category == "短炒":
|
||||
|
||||
Reference in New Issue
Block a user