fix: candidate_filter修3——S4无资金流数据改中性通过(cache只覆盖池内,池外不该压分),busy_timeout30→60(6worker并发写)
This commit is contained in:
@@ -25,7 +25,7 @@ UA = "Mozilla/5.0"
|
|||||||
|
|
||||||
def get_conn():
|
def get_conn():
|
||||||
c = sqlite3.connect(str(DB_PATH), timeout=30)
|
c = sqlite3.connect(str(DB_PATH), timeout=30)
|
||||||
c.execute("PRAGMA busy_timeout=30000")
|
c.execute("PRAGMA busy_timeout=60000") # 2026-08-24 30→60: 6worker并发写等待
|
||||||
return c
|
return c
|
||||||
|
|
||||||
def log_candidate(conn, code, stage, passed, detail):
|
def log_candidate(conn, code, stage, passed, detail):
|
||||||
@@ -193,7 +193,8 @@ def stage4_capital_flow(code, name):
|
|||||||
stocks = (_j.loads(r[0]) or {}).get("stocks") or {}
|
stocks = (_j.loads(r[0]) or {}).get("stocks") or {}
|
||||||
info = stocks.get(raw)
|
info = stocks.get(raw)
|
||||||
if not info or not info.get("flow"):
|
if not info or not info.get("flow"):
|
||||||
return False, 0, "无资金流数据"
|
# 2026-08-24 中性化:cache只覆盖池内股票,池外候选无数据不该压分(S4设计是筛资金差,不是筛没数据)
|
||||||
|
return True, 1, "无资金流数据(中性)"
|
||||||
flow = info["flow"] # [{date, main_net, super_large, ...}] 日期升序
|
flow = info["flow"] # [{date, main_net, super_large, ...}] 日期升序
|
||||||
recent = flow[-3:] # 近3日
|
recent = flow[-3:] # 近3日
|
||||||
score = 0
|
score = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user