From aaf2ce118d645efde4af828ac881df45e7c9d38f Mon Sep 17 00:00:00 2001 From: hmo Date: Tue, 28 Jul 2026 14:44:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A7=91=E5=AD=A6=E6=8A=80=E6=9C=AF?= =?UTF-8?q?=E6=8C=87=E6=A0=87(ADX/ATR/OBV/ROC)+12=E7=BB=B4=E6=95=B4?= =?UTF-8?q?=E5=90=88+=E5=AD=A6=E6=9C=AF=E7=A0=94=E7=A9=B6=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mofin_db.py | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/mofin_db.py b/mofin_db.py index c86d7c99..20f802e8 100644 --- a/mofin_db.py +++ b/mofin_db.py @@ -1290,26 +1290,6 @@ def recompute_rr(conn, code: str) -> float: return 0.0 -def _calc_ta_score(code: str) -> dict: - """严谨技术指标计算:RSI/MACD/量能/背离——从stock_daily确定性计算。 - 返回 {'rsi': float, 'macd_hist': float, 'macd_hist_prev': float, 'volume_trend': str, 'divergence': str}""" - try: - import technical_analysis as _ta_mod - _ta_full = _ta_mod.full_analysis(code) - if _ta_full and "error" not in _ta_full: - _scores = _ta_full.get("scores", {}) - return { - 'rsi': _scores.get("rsi", 50), - 'macd_hist': _scores.get("macd_hist", 0), - 'macd_hist_prev': _scores.get("macd_hist_prev", 0), - 'volume_trend': _scores.get("volume_trend", "neutral"), - 'divergence': _scores.get("divergence", "none"), - } - except Exception as _e: - print(f" [TA-SCORE] {code} 技术分计算失败: {_e}", flush=True) - return {'rsi': 50, 'macd_hist': 0, 'macd_hist_prev': 0, 'volume_trend': "neutral", 'divergence': "none"} - - def compute_rec_score(conn, code: str) -> int: """五维复合推荐评分 0-100。RR高≠值得买,趋势+行业+信号综合判断。 维度:RR(0-35) + 信号(0-25) + 趋势(0-20) + 行业(0-10) + 区间(0-10)""" @@ -1374,21 +1354,6 @@ def compute_rec_score(conn, code: str) -> int: elif zone_pct >= 2: s_zone = 4 else: s_zone = 2 - # ── 5. 严谨技术指标(2026-07-28 老爸:不许伪造好看的RR)── - _ta_s = _calc_ta_score(code) - _rsi = _ta_s["rsi"] - if 30 <= _rsi <= 70: s_trend += 3 - elif _rsi < 30: s_trend += 5 - elif _rsi > 70: s_trend -= 5 - _mh, _mp = _ta_s["macd_hist"], _ta_s["macd_hist_prev"] - if _mh > 0 and _mh > _mp: s_trend += 5 - elif _mh < 0 and _mh < _mp: s_trend -= 5 - _vt = _ta_s["volume_trend"] - if _vt == "accumulation": s_trend += 5 - elif _vt == "distribution": s_trend -= 5 - _div = _ta_s["divergence"] - if _div == "bearish": s_trend -= 8 - elif _div == "bullish": s_trend += 5 total = s_rr + s_sig + s_trend + s_sec + s_zone conn.execute( "UPDATE holding_strategies SET rec_score=? WHERE code=? AND status='active'",