feat: 周线+月线趋势/MA/支撑阻力注入mtf_context
This commit is contained in:
@@ -1458,6 +1458,30 @@ def reassess_strategy(code, name, price, cost, shares, current_action,
|
||||
parts.append(f"长撑:{stop_ref.get('source','?')}={stop_ref['level']}")
|
||||
if take_ref:
|
||||
parts.append(f"长压:{take_ref.get('source','?')}={take_ref['level']}")
|
||||
|
||||
# 周线趋势
|
||||
weekly = mtf_analysis.get("weekly", {})
|
||||
wt = weekly.get("trend", {})
|
||||
wm = weekly.get("mas", {})
|
||||
ws = weekly.get("support_resistance", {})
|
||||
if wt.get("direction"):
|
||||
parts.append(f"周线{wt['direction']}")
|
||||
if wm.get("ma5"):
|
||||
parts.append(f"周MA5={wm['ma5']}")
|
||||
if ws.get("weak_support"):
|
||||
parts.append(f"周撑={ws['weak_support']}")
|
||||
if ws.get("weak_resist"):
|
||||
parts.append(f"周压={ws['weak_resist']}")
|
||||
|
||||
# 月线趋势
|
||||
monthly = mtf_analysis.get("monthly", {})
|
||||
mt = monthly.get("trend", {})
|
||||
ms = monthly.get("mas", {})
|
||||
if mt.get("direction"):
|
||||
parts.append(f"月线{mt['direction']}")
|
||||
if ms.get("ma5"):
|
||||
parts.append(f"月MA5={ms['ma5']}")
|
||||
|
||||
mtf_context = " | ".join(parts)
|
||||
|
||||
now_str = datetime.now().strftime('%Y-%m-%d %H:%M')
|
||||
|
||||
Reference in New Issue
Block a user