feat: 周线+月线趋势/MA/支撑阻力注入mtf_context
This commit is contained in:
@@ -587,9 +587,30 @@ def full_analysis(code):
|
||||
if 'weekly' in mtf_raw:
|
||||
w = mtf_raw['weekly']
|
||||
ws = w.get('support_resistance', {})
|
||||
mtf['weekly_sr'] = {
|
||||
wt = w.get('trend', {})
|
||||
wm = w.get('mas', {})
|
||||
mtf['weekly'] = {
|
||||
'weak_resist': ws.get('weak_resist'),
|
||||
'weak_support': ws.get('weak_support'),
|
||||
'strong_resist': ws.get('strong_resist'),
|
||||
'strong_support': ws.get('strong_support'),
|
||||
'trend': wt.get('direction', ''),
|
||||
'ma5': wm.get('ma5'),
|
||||
'ma10': wm.get('ma10'),
|
||||
}
|
||||
# 月线作为长期参考
|
||||
if 'monthly' in mtf_raw:
|
||||
m = mtf_raw['monthly']
|
||||
ms = m.get('support_resistance', {})
|
||||
mt = m.get('trend', {})
|
||||
mm = m.get('mas', {})
|
||||
mtf['monthly'] = {
|
||||
'weak_resist': ms.get('weak_resist'),
|
||||
'weak_support': ms.get('weak_support'),
|
||||
'strong_resist': ms.get('strong_resist'),
|
||||
'strong_support': ms.get('strong_support'),
|
||||
'trend': mt.get('direction', ''),
|
||||
'ma5': mm.get('ma5'),
|
||||
}
|
||||
except Exception:
|
||||
pass # non-critical, graceful degradation
|
||||
|
||||
Reference in New Issue
Block a user