fix: 评分循环常量缺失 + 分钟线新浪备选

This commit is contained in:
lookt
2026-09-15 21:43:31 +08:00
parent 890ff36485
commit a1329442bd
2 changed files with 12 additions and 3 deletions
+8
View File
@@ -60,9 +60,17 @@ class KlineFetcher:
except Exception as e2: except Exception as e2:
raise e2 from e raise e2 from e
else: else:
try:
df = ak.stock_zh_a_hist_min_em(symbol=code, period=cfg['ak_period'], df = ak.stock_zh_a_hist_min_em(symbol=code, period=cfg['ak_period'],
start_date=start + ' 09:30:00', start_date=start + ' 09:30:00',
end_date=end + ' 15:00:00') end_date=end + ' 15:00:00')
except Exception as em_err:
# EM 分钟线被限速时回退新浪分钟线(仅 5/15/30/60 分钟)
sym = ('sh' if code[:1] == '6' else 'sz') + code
try:
df = ak.stock_zh_a_minute(symbol=sym, period=cfg['ak_period'], adjust='')
except Exception as e2:
raise e2 from em_err
if df is None or df.empty: if df is None or df.empty:
return pd.DataFrame() return pd.DataFrame()
df.columns = [str(c).lower() for c in df.columns] df.columns = [str(c).lower() for c in df.columns]
+1
View File
@@ -22,6 +22,7 @@ from src.analysis.event_impact import EventImpactService # noqa: E402
from src.quant.engine import QuantEngine # noqa: E402 from src.quant.engine import QuantEngine # noqa: E402
PORT = int(os.environ.get('PORT', '8100')) PORT = int(os.environ.get('PORT', '8100'))
SCORING_INTERVAL_S = int(os.environ.get('QUANT_SCORING_INTERVAL_S', '1800'))
ROOT = Path(__file__).resolve().parent.parent.parent ROOT = Path(__file__).resolve().parent.parent.parent
WEB_DIR = Path(__file__).resolve().parent WEB_DIR = Path(__file__).resolve().parent
RECENT_MAX = 500 RECENT_MAX = 500