From 8f7738d8b4df52c1b2104dc98a206554a60e01ac Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 8 Oct 2025 12:00:12 +0800 Subject: [PATCH] =?UTF-8?q?refactor=20stock=20pool=20selection=20order=20a?= =?UTF-8?q?nd=20set=20default=20to=20=E6=B2=AA=E6=B7=B1300?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/features/factors.py | 15 +++++++++++---- app/ui/views/stock_eval.py | 3 ++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/features/factors.py b/app/features/factors.py index 9378305..619d1ed 100644 --- a/app/features/factors.py +++ b/app/features/factors.py @@ -370,10 +370,17 @@ def _check_data_availability( ) return False - return ( - bool(basic_data.get("daily.close")) and - len(close_check) >= min_days - ) + # 获取收盘价数据并做最终检查 + close_price = latest_fields.get("daily.close") + if close_price is None or float(close_price) <= 0: + LOGGER.debug( + "收盘价数据无效 ts_code=%s date=%s price=%s", + ts_code, trade_date, close_price, + extra=LOG_EXTRA + ) + return False + + return True # 所有检查都通过 def _detect_and_handle_outliers( diff --git a/app/ui/views/stock_eval.py b/app/ui/views/stock_eval.py index dbfbc99..5574d7c 100644 --- a/app/ui/views/stock_eval.py +++ b/app/ui/views/stock_eval.py @@ -83,7 +83,8 @@ def render_stock_evaluation() -> None: st.markdown("##### 股票池范围") pool_type = st.radio( "选择股票池", - ["全部A股", "沪深300", "中证500", "中证1000", "自定义"], + ["沪深300", "中证500", "中证1000", "全部A股", "自定义"], + index=0, # 默认选择沪深300 horizontal=True )