refactor: update entry conditions in ATR EMA scanners for better precision
This commit is contained in:
parent
1b852b2d8d
commit
a9d380897a
@ -38,11 +38,16 @@ def check_entry_signal(df: pd.DataFrame) -> list:
|
||||
lower_band = results['lower_band'].iloc[i]
|
||||
prev_lower_band = results['lower_band'].iloc[i-1]
|
||||
|
||||
# Entry conditions
|
||||
# Entry conditions:
|
||||
# 1. Previous close was below the lower band
|
||||
# 2. Current close is at or above the lower band
|
||||
# 3. Price is moving up (current close > previous close)
|
||||
# 4. Price is still below EMA (maintaining downtrend context)
|
||||
entry_signal = (
|
||||
current['close'] < ema and
|
||||
previous['close'] <= prev_lower_band and
|
||||
current['close'] > previous['close']
|
||||
previous['close'] < prev_lower_band and
|
||||
current['close'] >= lower_band and
|
||||
current['close'] > previous['close'] and
|
||||
current['close'] < ema
|
||||
)
|
||||
|
||||
if entry_signal:
|
||||
|
||||
@ -38,11 +38,16 @@ def check_entry_signal(df: pd.DataFrame) -> list:
|
||||
lower_band = results['lower_band'].iloc[i]
|
||||
prev_lower_band = results['lower_band'].iloc[i-1]
|
||||
|
||||
# Entry conditions from Pine script:
|
||||
# Entry conditions:
|
||||
# 1. Previous close was below the lower band
|
||||
# 2. Current close is at or above the lower band
|
||||
# 3. Price is moving up (current close > previous close)
|
||||
# 4. Price is still below EMA (maintaining downtrend context)
|
||||
entry_signal = (
|
||||
current['close'] < ema and
|
||||
previous['close'] <= prev_lower_band and
|
||||
current['close'] > previous['close']
|
||||
previous['close'] < prev_lower_band and
|
||||
current['close'] >= lower_band and
|
||||
current['close'] > previous['close'] and
|
||||
current['close'] < ema
|
||||
)
|
||||
|
||||
if entry_signal:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user