대시보드 수정및 전략수정중
This commit is contained in:
@@ -10,7 +10,7 @@ from app.core.config import settings
|
||||
from app.core.market_schedule import is_market_open
|
||||
from app.services.korea_investment_api import korea_investment_api
|
||||
from app.services.mean_reversion_strategy import (
|
||||
MarketRegime, detect_market_regime, calculate_atr
|
||||
MarketRegime, detect_market_regime, calculate_atr, calculate_adx
|
||||
)
|
||||
from app.services.technical_indicators import (
|
||||
TREND_FILTER_ENABLED, TREND_MA_SHORT, TREND_MA_LONG, TREND_TOLERANCE_PCT,
|
||||
@@ -173,6 +173,10 @@ async def analyze_stock(stock_code: str, stock_name: str, criteria: Recommendati
|
||||
if current_price == 0:
|
||||
return None
|
||||
|
||||
# 전일 거래량 필터: 100만주 미만 종목 제외 (유동성 부족)
|
||||
if volume < 1_000_000:
|
||||
return None
|
||||
|
||||
if len(chart_data) >= 2:
|
||||
prev_price = float(chart_data[-2].get("stck_clpr", current_price))
|
||||
change_rate = ((current_price - prev_price) / prev_price) * 100 if prev_price > 0 else 0
|
||||
@@ -377,8 +381,8 @@ async def analyze_stock(stock_code: str, stock_name: str, criteria: Recommendati
|
||||
atr_14_val = calculate_atr(_h, _l, _c)
|
||||
if len(chart_data) >= 29:
|
||||
adx_14_val = calculate_adx(_h, _l, _c)
|
||||
except Exception:
|
||||
pass
|
||||
except Exception as _e:
|
||||
logger.debug(f"ATR/ADX 계산 실패 {stock_code}: {_e}")
|
||||
|
||||
if criteria.for_batch or len(signals) > 0 or score > 0:
|
||||
final_score = max(1, score) if len(signals) > 0 else score
|
||||
|
||||
Reference in New Issue
Block a user