Files
MoFin/check_key_levels.py
知微 (MoFin) aa0f740381 MoFin 初始提交
完整数据采集+分析管道:
- market_watch.py:90行业板块采集(同花顺/东方财富)
- 市场精选推荐 cron:全市场分析+候选池+星级推荐
- price_monitor.py:持仓/自选高频价格监控
- refresh_mtf_cache.py:多周期K线缓存
- 策略评估/知识萃取管道

文档:docs/ 含完整需求+架构设计
注意:尚未配置 git remote,笑笑接手后自行配置
2026-06-20 12:04:21 +08:00

70 lines
2.6 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env python3
import json
import sys
# 读取实时数据
with open('data/temp_realtime.json', 'r') as f:
data = json.load(f)
prices = data['prices']
holdings = data['holdings']
print("=== 关键价位检查 ===")
# 检查每个持仓的关键价位
for holding in holdings:
code = holding['code']
name = holding['name']
current_price = holding['price']
analysis = holding.get('analysis', {})
stop_loss = analysis.get('stop_loss')
take_profit = analysis.get('take_profit')
if stop_loss and stop_loss != '':
try:
stop_loss_val = float(stop_loss)
distance_pct = (current_price - stop_loss_val) / stop_loss_val * 100
if distance_pct < 5: # 距离止损不到5%
print(f"⚠️ {name}({code}) 现价{current_price} 距止损{stop_loss_val}{abs(distance_pct):.1f}%")
except:
pass
if take_profit and take_profit != '':
try:
take_profit_val = float(take_profit)
distance_pct = (take_profit_val - current_price) / current_price * 100
if distance_pct < 5: # 距离止盈不到5%
print(f"🎯 {name}({code}) 现价{current_price} 距止盈{take_profit_val}{abs(distance_pct):.1f}%")
except:
pass
# 检查涨跌幅超过5%的股票
print("\n=== 异动股票检查(涨跌幅>5% ===")
for code, price_data in prices.items():
change_pct = price_data['change_pct']
if abs(change_pct) >= 5:
name = price_data['name']
price = price_data['price']
print(f"{'📈' if change_pct > 0 else '📉'} {name}({code}) 现价{price} {change_pct:+.2f}%")
# 检查决策库中的操作区间
print("\n=== 决策库操作区间检查 ===")
# 这里需要读取决策库,但数据太大,我们只检查几个关键股票
key_stocks = ['06160', '600110', '688411', '01478']
for code in key_stocks:
if code in prices:
price_data = prices[code]
name = price_data['name']
price = price_data['price']
# 根据历史回顾判断
if code == '06160':
print(f"🔵 {name}({code}) 现价{price} → 两批试仓已完成,止损160安全,目标175/185")
elif code == '600110':
print(f"🔵 {name}({code}) 现价{price} → 6月4日已按11.5~11.8加仓,现价仍在区间内")
elif code == '688411':
print(f"⚠️ {name}({code}) 现价{price} → 大涨10.87%,追踪止盈290接近,注意风险")
elif code == '01478':
print(f"⚠️ {name}({code}) 现价{price} → 反弹7.44%,深套股反弹至13~14可减仓")