feat: add ADX filter to block sideways market entries
ADX < 25 now returns HOLD in get_signal(), preventing entries during trendless (sideways) markets. NaN ADX values fall through to existing weighted signal logic. Also syncs the vectorized dataset builder with the same ADX filter to keep training data consistent. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -60,6 +60,12 @@ class Indicators:
|
||||
last = df.iloc[-1]
|
||||
prev = df.iloc[-2]
|
||||
|
||||
# ADX 횡보장 필터: ADX < 25이면 추세 부재로 판단하여 진입 차단
|
||||
adx = last.get("adx", None)
|
||||
if adx is not None and not pd.isna(adx) and adx < 25:
|
||||
logger.debug(f"ADX 필터: {adx:.1f} < 25 — HOLD")
|
||||
return "HOLD"
|
||||
|
||||
long_signals = 0
|
||||
short_signals = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user