Files
xxm c68f987653 chore(cleansweep): 代码大扫除——归档hermes 111个死工具+4个废弃scanner,收敛MoFin/scripts重复副本,删除根旧版mo_models
- archive/hermes-dead-tools-20260820/: hermes独有不在cron不被import的111个一次性排查/测试工具
- archive/hermes-dead-tools-20260820/: 4个废弃scanner(btd1_v3/market_scanner/market_thermometer已废弃/s2v2)
- archive/legacy-cleanup-20260820/: MoFin根2旧版(mo_models/technical_analysis)+/home/hmo/scripts无引用旧项目+MoFin/scripts重复prepare_report_data
- 删除MoFin根mo_models.py(根旧版,deploy/profile-scripts权威保留)
- 保留: mofin_db.py/mo_data.py硬链接(server.py多层sys.path需各目录访问同一inode,非冗余)
- fix_gateway.py保留(Gateway看门狗fix_gateway_port.py的活跃依赖,勿误删)
- 验证: cron所有脚本引用无缺失, key模块import正常
- hermes独有从116收敛到5核心(alert_logger/market_screener/prepare_report_data/self_todo_executor_v2/xmpp_zhiwei_bot)
2026-08-20 10:36:25 +08:00

22 lines
1.0 KiB
Python

import sys
sys.path.insert(0, '/home/hmo/.hermes/profiles/position-analyst/scripts')
sys.path.insert(0, '/home/hmo/MoFin')
from strategy_lifecycle import validate_strategy
# 模拟 97 中心坏数据(5元股票被写成中心97)
bad = {'code': '000711', 'price': 5.69, 'entry_low': 94.0, 'entry_high': 100.0,
'stop_loss': 90.0, 'take_profit': 110.0, 'timing_signal': '买入',
'rr_ratio': 2.0, 'tech_snapshot': '强撑94 弱撑95 弱压99 强压100',
'sector_context': '环保', 'signal_factors': ['x'], 'currency': 'CNY'}
passed, failures = validate_strategy(bad)
print('坏数据(中心97 vs 价5.69): passed =', passed)
for f in failures:
print(' FAIL:', f.get('id'), '-', f.get('desc', '')[:60])
# 正常数据
good = dict(bad)
good['entry_low'], good['entry_high'], good['stop_loss'], good['take_profit'] = 5.23, 6.15, 5.0, 7.0
passed2, failures2 = validate_strategy(good)
print('好数据(区5.23~6.15): passed =', passed2)
for f in failures2:
print(' FAIL:', f.get('id'), '-', f.get('desc', '')[:60])